@sprucelabs/spruce-file-utils 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/.spruce/schemas/schemas.types.d.ts +215 -81
- package/build/esm/.spruce/schemas/schemas.types.d.ts +215 -81
- package/build/esm/uploading/LocalUploadStrategy.d.ts +15 -0
- package/build/esm/uploading/LocalUploadStrategy.js +18 -2
- package/build/esm/uploading/S3UploadStrategy.d.ts +20 -0
- package/build/esm/uploading/S3UploadStrategy.js +22 -1
- package/build/uploading/LocalUploadStrategy.d.ts +15 -0
- package/build/uploading/LocalUploadStrategy.js +15 -0
- package/build/uploading/S3UploadStrategy.d.ts +20 -0
- package/build/uploading/S3UploadStrategy.js +21 -0
- package/package.json +1 -1
@@ -593,6 +593,43 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
593
593
|
interface UpsertThemeEmitTargetEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeEmitTargetSchema> {
|
594
594
|
}
|
595
595
|
}
|
596
|
+
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
597
|
+
interface Theme {
|
598
|
+
'slug': string;
|
599
|
+
'name': string;
|
600
|
+
'props': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemeProps;
|
601
|
+
}
|
602
|
+
interface ThemeSchema extends SpruceSchema.Schema {
|
603
|
+
id: 'theme';
|
604
|
+
version: 'v2021_02_11';
|
605
|
+
namespace: 'Heartwood';
|
606
|
+
name: 'Theme';
|
607
|
+
fields: {
|
608
|
+
/** . */
|
609
|
+
'slug': {
|
610
|
+
type: 'id';
|
611
|
+
isRequired: true;
|
612
|
+
options: undefined;
|
613
|
+
};
|
614
|
+
/** . */
|
615
|
+
'name': {
|
616
|
+
type: 'text';
|
617
|
+
isRequired: true;
|
618
|
+
options: undefined;
|
619
|
+
};
|
620
|
+
/** . */
|
621
|
+
'props': {
|
622
|
+
type: 'schema';
|
623
|
+
isRequired: true;
|
624
|
+
options: {
|
625
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemePropsSchema;
|
626
|
+
};
|
627
|
+
};
|
628
|
+
};
|
629
|
+
}
|
630
|
+
interface ThemeEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema> {
|
631
|
+
}
|
632
|
+
}
|
596
633
|
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
597
634
|
interface UpsertThemeEmitPayload {
|
598
635
|
'theme': SpruceSchemas.Heartwood.v2021_02_11.Theme;
|
@@ -659,63 +696,142 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
659
696
|
}
|
660
697
|
}
|
661
698
|
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
662
|
-
interface
|
663
|
-
'
|
664
|
-
'name': string;
|
665
|
-
'props': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemeProps;
|
699
|
+
interface UpsertThemeResponsePayload {
|
700
|
+
'theme': SpruceSchemas.Heartwood.v2021_02_11.Theme;
|
666
701
|
}
|
667
|
-
interface
|
668
|
-
id: '
|
702
|
+
interface UpsertThemeResponsePayloadSchema extends SpruceSchema.Schema {
|
703
|
+
id: 'upsertThemeResponsePayload';
|
669
704
|
version: 'v2021_02_11';
|
670
705
|
namespace: 'Heartwood';
|
671
|
-
name: '
|
706
|
+
name: '';
|
672
707
|
fields: {
|
673
708
|
/** . */
|
674
|
-
'
|
709
|
+
'theme': {
|
710
|
+
type: 'schema';
|
711
|
+
isRequired: true;
|
712
|
+
options: {
|
713
|
+
schema: SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema;
|
714
|
+
};
|
715
|
+
};
|
716
|
+
};
|
717
|
+
}
|
718
|
+
interface UpsertThemeResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeResponsePayloadSchema> {
|
719
|
+
}
|
720
|
+
}
|
721
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
|
+
interface SaveLocalSettingsEmitTarget {
|
723
|
+
'organizationId': string;
|
724
|
+
}
|
725
|
+
interface SaveLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
726
|
+
id: 'saveLocalSettingsEmitTarget';
|
727
|
+
version: 'v2022_05_13';
|
728
|
+
namespace: 'Files';
|
729
|
+
name: '';
|
730
|
+
fields: {
|
731
|
+
/** . */
|
732
|
+
'organizationId': {
|
675
733
|
type: 'id';
|
676
734
|
isRequired: true;
|
677
735
|
options: undefined;
|
678
736
|
};
|
679
|
-
|
680
|
-
|
737
|
+
};
|
738
|
+
}
|
739
|
+
interface SaveLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetSchema> {
|
740
|
+
}
|
741
|
+
}
|
742
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
|
+
interface SaveLocalSettingsEmitPayload {
|
744
|
+
/** Local Upload Directory. */
|
745
|
+
'localUploadDir': string;
|
746
|
+
/** File Host URL. */
|
747
|
+
'fileHostUrl': string;
|
748
|
+
}
|
749
|
+
interface SaveLocalSettingsEmitPayloadSchema extends SpruceSchema.Schema {
|
750
|
+
id: 'saveLocalSettingsEmitPayload';
|
751
|
+
version: 'v2022_05_13';
|
752
|
+
namespace: 'Files';
|
753
|
+
name: '';
|
754
|
+
fields: {
|
755
|
+
/** Local Upload Directory. */
|
756
|
+
'localUploadDir': {
|
757
|
+
label: 'Local Upload Directory';
|
758
|
+
type: 'text';
|
759
|
+
isRequired: true;
|
760
|
+
options: undefined;
|
761
|
+
};
|
762
|
+
/** File Host URL. */
|
763
|
+
'fileHostUrl': {
|
764
|
+
label: 'File Host URL';
|
681
765
|
type: 'text';
|
682
766
|
isRequired: true;
|
683
767
|
options: undefined;
|
684
768
|
};
|
769
|
+
};
|
770
|
+
}
|
771
|
+
interface SaveLocalSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayloadSchema> {
|
772
|
+
}
|
773
|
+
}
|
774
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
775
|
+
interface SaveLocalSettingsEmitTargetAndPayload {
|
776
|
+
/** Source. */
|
777
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
778
|
+
'target': SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTarget;
|
779
|
+
'payload': SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayload;
|
780
|
+
}
|
781
|
+
interface SaveLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
782
|
+
id: 'saveLocalSettingsEmitTargetAndPayload';
|
783
|
+
version: 'v2022_05_13';
|
784
|
+
namespace: 'Files';
|
785
|
+
name: '';
|
786
|
+
fields: {
|
787
|
+
/** Source. */
|
788
|
+
'source': {
|
789
|
+
label: 'Source';
|
790
|
+
type: 'schema';
|
791
|
+
options: {
|
792
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
793
|
+
};
|
794
|
+
};
|
685
795
|
/** . */
|
686
|
-
'
|
796
|
+
'target': {
|
687
797
|
type: 'schema';
|
688
798
|
isRequired: true;
|
689
799
|
options: {
|
690
|
-
schema: SpruceSchemas.
|
800
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetSchema;
|
801
|
+
};
|
802
|
+
};
|
803
|
+
/** . */
|
804
|
+
'payload': {
|
805
|
+
type: 'schema';
|
806
|
+
isRequired: true;
|
807
|
+
options: {
|
808
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayloadSchema;
|
691
809
|
};
|
692
810
|
};
|
693
811
|
};
|
694
812
|
}
|
695
|
-
interface
|
813
|
+
interface SaveLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetAndPayloadSchema> {
|
696
814
|
}
|
697
815
|
}
|
698
|
-
namespace SpruceSchemas.
|
699
|
-
interface
|
700
|
-
'
|
816
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
817
|
+
interface SaveLocalSettingsResponsePayload {
|
818
|
+
'wasSuccessful': boolean;
|
701
819
|
}
|
702
|
-
interface
|
703
|
-
id: '
|
704
|
-
version: '
|
705
|
-
namespace: '
|
820
|
+
interface SaveLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
821
|
+
id: 'saveLocalSettingsResponsePayload';
|
822
|
+
version: 'v2022_05_13';
|
823
|
+
namespace: 'Files';
|
706
824
|
name: '';
|
707
825
|
fields: {
|
708
826
|
/** . */
|
709
|
-
'
|
710
|
-
type: '
|
827
|
+
'wasSuccessful': {
|
828
|
+
type: 'boolean';
|
711
829
|
isRequired: true;
|
712
|
-
options:
|
713
|
-
schema: SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema;
|
714
|
-
};
|
830
|
+
options: undefined;
|
715
831
|
};
|
716
832
|
};
|
717
833
|
}
|
718
|
-
interface
|
834
|
+
interface SaveLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsResponsePayloadSchema> {
|
719
835
|
}
|
720
836
|
}
|
721
837
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -739,6 +855,39 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
739
855
|
interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
|
740
856
|
}
|
741
857
|
}
|
858
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
859
|
+
interface GetSettingsStatusEmitTargetAndPayload {
|
860
|
+
/** Source. */
|
861
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
862
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
863
|
+
}
|
864
|
+
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
865
|
+
id: 'getSettingsStatusEmitTargetAndPayload';
|
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.GetSettingsStatusEmitTargetSchema;
|
884
|
+
};
|
885
|
+
};
|
886
|
+
};
|
887
|
+
}
|
888
|
+
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
889
|
+
}
|
890
|
+
}
|
742
891
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
892
|
interface GetSettingsStatusResponsePayload {
|
744
893
|
'didSupplyS3Creds': boolean;
|
@@ -879,61 +1028,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
879
1028
|
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
880
1029
|
}
|
881
1030
|
}
|
882
|
-
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 {
|
906
|
-
/** Source. */
|
907
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
908
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
909
|
-
}
|
910
|
-
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
911
|
-
id: 'getSettingsStatusEmitTargetAndPayload';
|
912
|
-
version: 'v2022_05_13';
|
913
|
-
namespace: 'Files';
|
914
|
-
name: '';
|
915
|
-
fields: {
|
916
|
-
/** Source. */
|
917
|
-
'source': {
|
918
|
-
label: 'Source';
|
919
|
-
type: 'schema';
|
920
|
-
options: {
|
921
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
922
|
-
};
|
923
|
-
};
|
924
|
-
/** . */
|
925
|
-
'target': {
|
926
|
-
type: 'schema';
|
927
|
-
isRequired: true;
|
928
|
-
options: {
|
929
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
930
|
-
};
|
931
|
-
};
|
932
|
-
};
|
933
|
-
}
|
934
|
-
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
935
|
-
}
|
936
|
-
}
|
937
1031
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
938
1032
|
interface UploadEmitTarget {
|
939
1033
|
'locationId'?: string | undefined | null;
|
@@ -1035,6 +1129,28 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1035
1129
|
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1036
1130
|
}
|
1037
1131
|
}
|
1132
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1133
|
+
interface GetUploadEndpointResponsePayload {
|
1134
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1135
|
+
'restEndpointUrl'?: string | undefined | null;
|
1136
|
+
}
|
1137
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1138
|
+
id: 'getUploadEndpointResponsePayload';
|
1139
|
+
version: 'v2022_05_13';
|
1140
|
+
namespace: 'Files';
|
1141
|
+
name: '';
|
1142
|
+
fields: {
|
1143
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1144
|
+
'restEndpointUrl': {
|
1145
|
+
type: 'text';
|
1146
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1147
|
+
options: undefined;
|
1148
|
+
};
|
1149
|
+
};
|
1150
|
+
}
|
1151
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1152
|
+
}
|
1153
|
+
}
|
1038
1154
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1039
1155
|
interface UploadedFile {
|
1040
1156
|
'id': string;
|
@@ -1130,6 +1246,10 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1130
1246
|
'awsSecretAccessKey': string;
|
1131
1247
|
/** AWS S3 Bucket. */
|
1132
1248
|
'awsS3Bucket': string;
|
1249
|
+
/** Local Upload Directory. */
|
1250
|
+
'localUploadDir': string;
|
1251
|
+
/** File Host URL. */
|
1252
|
+
'fileHostUrl': string;
|
1133
1253
|
'target'?: SpruceSchemas.Files.v2022_05_13.SettingsTarget | undefined | null;
|
1134
1254
|
}
|
1135
1255
|
interface SettingsSchema extends SpruceSchema.Schema {
|
@@ -1165,6 +1285,20 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1165
1285
|
isRequired: true;
|
1166
1286
|
options: undefined;
|
1167
1287
|
};
|
1288
|
+
/** Local Upload Directory. */
|
1289
|
+
'localUploadDir': {
|
1290
|
+
label: 'Local Upload Directory';
|
1291
|
+
type: 'text';
|
1292
|
+
isRequired: true;
|
1293
|
+
options: undefined;
|
1294
|
+
};
|
1295
|
+
/** File Host URL. */
|
1296
|
+
'fileHostUrl': {
|
1297
|
+
label: 'File Host URL';
|
1298
|
+
type: 'text';
|
1299
|
+
isRequired: true;
|
1300
|
+
options: undefined;
|
1301
|
+
};
|
1168
1302
|
/** . */
|
1169
1303
|
'target': {
|
1170
1304
|
type: 'schema';
|
@@ -593,6 +593,43 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
593
593
|
interface UpsertThemeEmitTargetEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeEmitTargetSchema> {
|
594
594
|
}
|
595
595
|
}
|
596
|
+
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
597
|
+
interface Theme {
|
598
|
+
'slug': string;
|
599
|
+
'name': string;
|
600
|
+
'props': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemeProps;
|
601
|
+
}
|
602
|
+
interface ThemeSchema extends SpruceSchema.Schema {
|
603
|
+
id: 'theme';
|
604
|
+
version: 'v2021_02_11';
|
605
|
+
namespace: 'Heartwood';
|
606
|
+
name: 'Theme';
|
607
|
+
fields: {
|
608
|
+
/** . */
|
609
|
+
'slug': {
|
610
|
+
type: 'id';
|
611
|
+
isRequired: true;
|
612
|
+
options: undefined;
|
613
|
+
};
|
614
|
+
/** . */
|
615
|
+
'name': {
|
616
|
+
type: 'text';
|
617
|
+
isRequired: true;
|
618
|
+
options: undefined;
|
619
|
+
};
|
620
|
+
/** . */
|
621
|
+
'props': {
|
622
|
+
type: 'schema';
|
623
|
+
isRequired: true;
|
624
|
+
options: {
|
625
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemePropsSchema;
|
626
|
+
};
|
627
|
+
};
|
628
|
+
};
|
629
|
+
}
|
630
|
+
interface ThemeEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema> {
|
631
|
+
}
|
632
|
+
}
|
596
633
|
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
597
634
|
interface UpsertThemeEmitPayload {
|
598
635
|
'theme': SpruceSchemas.Heartwood.v2021_02_11.Theme;
|
@@ -659,63 +696,142 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
659
696
|
}
|
660
697
|
}
|
661
698
|
namespace SpruceSchemas.Heartwood.v2021_02_11 {
|
662
|
-
interface
|
663
|
-
'
|
664
|
-
'name': string;
|
665
|
-
'props': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ThemeProps;
|
699
|
+
interface UpsertThemeResponsePayload {
|
700
|
+
'theme': SpruceSchemas.Heartwood.v2021_02_11.Theme;
|
666
701
|
}
|
667
|
-
interface
|
668
|
-
id: '
|
702
|
+
interface UpsertThemeResponsePayloadSchema extends SpruceSchema.Schema {
|
703
|
+
id: 'upsertThemeResponsePayload';
|
669
704
|
version: 'v2021_02_11';
|
670
705
|
namespace: 'Heartwood';
|
671
|
-
name: '
|
706
|
+
name: '';
|
672
707
|
fields: {
|
673
708
|
/** . */
|
674
|
-
'
|
709
|
+
'theme': {
|
710
|
+
type: 'schema';
|
711
|
+
isRequired: true;
|
712
|
+
options: {
|
713
|
+
schema: SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema;
|
714
|
+
};
|
715
|
+
};
|
716
|
+
};
|
717
|
+
}
|
718
|
+
interface UpsertThemeResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeResponsePayloadSchema> {
|
719
|
+
}
|
720
|
+
}
|
721
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
|
+
interface SaveLocalSettingsEmitTarget {
|
723
|
+
'organizationId': string;
|
724
|
+
}
|
725
|
+
interface SaveLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
726
|
+
id: 'saveLocalSettingsEmitTarget';
|
727
|
+
version: 'v2022_05_13';
|
728
|
+
namespace: 'Files';
|
729
|
+
name: '';
|
730
|
+
fields: {
|
731
|
+
/** . */
|
732
|
+
'organizationId': {
|
675
733
|
type: 'id';
|
676
734
|
isRequired: true;
|
677
735
|
options: undefined;
|
678
736
|
};
|
679
|
-
|
680
|
-
|
737
|
+
};
|
738
|
+
}
|
739
|
+
interface SaveLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetSchema> {
|
740
|
+
}
|
741
|
+
}
|
742
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
|
+
interface SaveLocalSettingsEmitPayload {
|
744
|
+
/** Local Upload Directory. */
|
745
|
+
'localUploadDir': string;
|
746
|
+
/** File Host URL. */
|
747
|
+
'fileHostUrl': string;
|
748
|
+
}
|
749
|
+
interface SaveLocalSettingsEmitPayloadSchema extends SpruceSchema.Schema {
|
750
|
+
id: 'saveLocalSettingsEmitPayload';
|
751
|
+
version: 'v2022_05_13';
|
752
|
+
namespace: 'Files';
|
753
|
+
name: '';
|
754
|
+
fields: {
|
755
|
+
/** Local Upload Directory. */
|
756
|
+
'localUploadDir': {
|
757
|
+
label: 'Local Upload Directory';
|
758
|
+
type: 'text';
|
759
|
+
isRequired: true;
|
760
|
+
options: undefined;
|
761
|
+
};
|
762
|
+
/** File Host URL. */
|
763
|
+
'fileHostUrl': {
|
764
|
+
label: 'File Host URL';
|
681
765
|
type: 'text';
|
682
766
|
isRequired: true;
|
683
767
|
options: undefined;
|
684
768
|
};
|
769
|
+
};
|
770
|
+
}
|
771
|
+
interface SaveLocalSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayloadSchema> {
|
772
|
+
}
|
773
|
+
}
|
774
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
775
|
+
interface SaveLocalSettingsEmitTargetAndPayload {
|
776
|
+
/** Source. */
|
777
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
778
|
+
'target': SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTarget;
|
779
|
+
'payload': SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayload;
|
780
|
+
}
|
781
|
+
interface SaveLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
782
|
+
id: 'saveLocalSettingsEmitTargetAndPayload';
|
783
|
+
version: 'v2022_05_13';
|
784
|
+
namespace: 'Files';
|
785
|
+
name: '';
|
786
|
+
fields: {
|
787
|
+
/** Source. */
|
788
|
+
'source': {
|
789
|
+
label: 'Source';
|
790
|
+
type: 'schema';
|
791
|
+
options: {
|
792
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
793
|
+
};
|
794
|
+
};
|
685
795
|
/** . */
|
686
|
-
'
|
796
|
+
'target': {
|
687
797
|
type: 'schema';
|
688
798
|
isRequired: true;
|
689
799
|
options: {
|
690
|
-
schema: SpruceSchemas.
|
800
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetSchema;
|
801
|
+
};
|
802
|
+
};
|
803
|
+
/** . */
|
804
|
+
'payload': {
|
805
|
+
type: 'schema';
|
806
|
+
isRequired: true;
|
807
|
+
options: {
|
808
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitPayloadSchema;
|
691
809
|
};
|
692
810
|
};
|
693
811
|
};
|
694
812
|
}
|
695
|
-
interface
|
813
|
+
interface SaveLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsEmitTargetAndPayloadSchema> {
|
696
814
|
}
|
697
815
|
}
|
698
|
-
namespace SpruceSchemas.
|
699
|
-
interface
|
700
|
-
'
|
816
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
817
|
+
interface SaveLocalSettingsResponsePayload {
|
818
|
+
'wasSuccessful': boolean;
|
701
819
|
}
|
702
|
-
interface
|
703
|
-
id: '
|
704
|
-
version: '
|
705
|
-
namespace: '
|
820
|
+
interface SaveLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
821
|
+
id: 'saveLocalSettingsResponsePayload';
|
822
|
+
version: 'v2022_05_13';
|
823
|
+
namespace: 'Files';
|
706
824
|
name: '';
|
707
825
|
fields: {
|
708
826
|
/** . */
|
709
|
-
'
|
710
|
-
type: '
|
827
|
+
'wasSuccessful': {
|
828
|
+
type: 'boolean';
|
711
829
|
isRequired: true;
|
712
|
-
options:
|
713
|
-
schema: SpruceSchemas.Heartwood.v2021_02_11.ThemeSchema;
|
714
|
-
};
|
830
|
+
options: undefined;
|
715
831
|
};
|
716
832
|
};
|
717
833
|
}
|
718
|
-
interface
|
834
|
+
interface SaveLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsResponsePayloadSchema> {
|
719
835
|
}
|
720
836
|
}
|
721
837
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -739,6 +855,39 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
739
855
|
interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
|
740
856
|
}
|
741
857
|
}
|
858
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
859
|
+
interface GetSettingsStatusEmitTargetAndPayload {
|
860
|
+
/** Source. */
|
861
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
862
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
863
|
+
}
|
864
|
+
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
865
|
+
id: 'getSettingsStatusEmitTargetAndPayload';
|
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.GetSettingsStatusEmitTargetSchema;
|
884
|
+
};
|
885
|
+
};
|
886
|
+
};
|
887
|
+
}
|
888
|
+
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
889
|
+
}
|
890
|
+
}
|
742
891
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
892
|
interface GetSettingsStatusResponsePayload {
|
744
893
|
'didSupplyS3Creds': boolean;
|
@@ -879,61 +1028,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
879
1028
|
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
880
1029
|
}
|
881
1030
|
}
|
882
|
-
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 {
|
906
|
-
/** Source. */
|
907
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
908
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
909
|
-
}
|
910
|
-
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
911
|
-
id: 'getSettingsStatusEmitTargetAndPayload';
|
912
|
-
version: 'v2022_05_13';
|
913
|
-
namespace: 'Files';
|
914
|
-
name: '';
|
915
|
-
fields: {
|
916
|
-
/** Source. */
|
917
|
-
'source': {
|
918
|
-
label: 'Source';
|
919
|
-
type: 'schema';
|
920
|
-
options: {
|
921
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
922
|
-
};
|
923
|
-
};
|
924
|
-
/** . */
|
925
|
-
'target': {
|
926
|
-
type: 'schema';
|
927
|
-
isRequired: true;
|
928
|
-
options: {
|
929
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
930
|
-
};
|
931
|
-
};
|
932
|
-
};
|
933
|
-
}
|
934
|
-
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
935
|
-
}
|
936
|
-
}
|
937
1031
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
938
1032
|
interface UploadEmitTarget {
|
939
1033
|
'locationId'?: string | undefined | null;
|
@@ -1035,6 +1129,28 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1035
1129
|
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1036
1130
|
}
|
1037
1131
|
}
|
1132
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1133
|
+
interface GetUploadEndpointResponsePayload {
|
1134
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1135
|
+
'restEndpointUrl'?: string | undefined | null;
|
1136
|
+
}
|
1137
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1138
|
+
id: 'getUploadEndpointResponsePayload';
|
1139
|
+
version: 'v2022_05_13';
|
1140
|
+
namespace: 'Files';
|
1141
|
+
name: '';
|
1142
|
+
fields: {
|
1143
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1144
|
+
'restEndpointUrl': {
|
1145
|
+
type: 'text';
|
1146
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1147
|
+
options: undefined;
|
1148
|
+
};
|
1149
|
+
};
|
1150
|
+
}
|
1151
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1152
|
+
}
|
1153
|
+
}
|
1038
1154
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1039
1155
|
interface UploadedFile {
|
1040
1156
|
'id': string;
|
@@ -1130,6 +1246,10 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1130
1246
|
'awsSecretAccessKey': string;
|
1131
1247
|
/** AWS S3 Bucket. */
|
1132
1248
|
'awsS3Bucket': string;
|
1249
|
+
/** Local Upload Directory. */
|
1250
|
+
'localUploadDir': string;
|
1251
|
+
/** File Host URL. */
|
1252
|
+
'fileHostUrl': string;
|
1133
1253
|
'target'?: SpruceSchemas.Files.v2022_05_13.SettingsTarget | undefined | null;
|
1134
1254
|
}
|
1135
1255
|
interface SettingsSchema extends SpruceSchema.Schema {
|
@@ -1165,6 +1285,20 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1165
1285
|
isRequired: true;
|
1166
1286
|
options: undefined;
|
1167
1287
|
};
|
1288
|
+
/** Local Upload Directory. */
|
1289
|
+
'localUploadDir': {
|
1290
|
+
label: 'Local Upload Directory';
|
1291
|
+
type: 'text';
|
1292
|
+
isRequired: true;
|
1293
|
+
options: undefined;
|
1294
|
+
};
|
1295
|
+
/** File Host URL. */
|
1296
|
+
'fileHostUrl': {
|
1297
|
+
label: 'File Host URL';
|
1298
|
+
type: 'text';
|
1299
|
+
isRequired: true;
|
1300
|
+
options: undefined;
|
1301
|
+
};
|
1168
1302
|
/** . */
|
1169
1303
|
'target': {
|
1170
1304
|
type: 'schema';
|
@@ -3,6 +3,21 @@ 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
|
+
isRequired: true;
|
13
|
+
};
|
14
|
+
fileHostUrl: {
|
15
|
+
label: string;
|
16
|
+
type: "text";
|
17
|
+
isRequired: true;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
};
|
6
21
|
constructor(options: {
|
7
22
|
localUploadDir: string;
|
8
23
|
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
|
-
|
12
|
+
class LocalUploadStrategy {
|
13
13
|
constructor(options) {
|
14
14
|
const { localUploadDir, fileHostUrl } = assertOptions(options, [
|
15
15
|
'localUploadDir',
|
@@ -32,3 +32,19 @@ 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
|
+
isRequired: true,
|
42
|
+
},
|
43
|
+
fileHostUrl: {
|
44
|
+
label: 'File Host URL',
|
45
|
+
type: 'text',
|
46
|
+
isRequired: true,
|
47
|
+
},
|
48
|
+
},
|
49
|
+
});
|
50
|
+
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
|
+
isRequired: true;
|
12
|
+
};
|
13
|
+
awsSecretAccessKey: {
|
14
|
+
label: string;
|
15
|
+
type: "text";
|
16
|
+
isRequired: true;
|
17
|
+
};
|
18
|
+
awsS3Bucket: {
|
19
|
+
label: string;
|
20
|
+
type: "text";
|
21
|
+
isRequired: true;
|
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
|
+
isRequired: true,
|
60
|
+
},
|
61
|
+
awsSecretAccessKey: {
|
62
|
+
label: 'AWS Secret Access Key',
|
63
|
+
type: 'text',
|
64
|
+
isRequired: true,
|
65
|
+
},
|
66
|
+
awsS3Bucket: {
|
67
|
+
label: 'AWS S3 Bucket',
|
68
|
+
type: 'text',
|
69
|
+
isRequired: true,
|
70
|
+
},
|
71
|
+
},
|
72
|
+
});
|
52
73
|
export default S3UploadStrategy;
|
@@ -3,6 +3,21 @@ 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
|
+
isRequired: true;
|
13
|
+
};
|
14
|
+
fileHostUrl: {
|
15
|
+
label: string;
|
16
|
+
type: "text";
|
17
|
+
isRequired: true;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
};
|
6
21
|
constructor(options: {
|
7
22
|
localUploadDir: string;
|
8
23
|
fileHostUrl: string;
|
@@ -22,4 +22,19 @@ 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
|
+
isRequired: true,
|
32
|
+
},
|
33
|
+
fileHostUrl: {
|
34
|
+
label: 'File Host URL',
|
35
|
+
type: 'text',
|
36
|
+
isRequired: true,
|
37
|
+
},
|
38
|
+
},
|
39
|
+
});
|
25
40
|
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
|
+
isRequired: true;
|
12
|
+
};
|
13
|
+
awsSecretAccessKey: {
|
14
|
+
label: string;
|
15
|
+
type: "text";
|
16
|
+
isRequired: true;
|
17
|
+
};
|
18
|
+
awsS3Bucket: {
|
19
|
+
label: string;
|
20
|
+
type: "text";
|
21
|
+
isRequired: true;
|
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
|
+
isRequired: true,
|
54
|
+
},
|
55
|
+
awsSecretAccessKey: {
|
56
|
+
label: 'AWS Secret Access Key',
|
57
|
+
type: 'text',
|
58
|
+
isRequired: true,
|
59
|
+
},
|
60
|
+
awsS3Bucket: {
|
61
|
+
label: 'AWS S3 Bucket',
|
62
|
+
type: 'text',
|
63
|
+
isRequired: true,
|
64
|
+
},
|
65
|
+
},
|
66
|
+
});
|
46
67
|
exports.default = S3UploadStrategy;
|