@23blocks/block-files 3.1.1 → 3.3.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.
Files changed (34) hide show
  1. package/dist/index.esm.js +363 -3
  2. package/dist/src/lib/files.block.d.ts +5 -1
  3. package/dist/src/lib/files.block.d.ts.map +1 -1
  4. package/dist/src/lib/mappers/delegation.mapper.d.ts +4 -0
  5. package/dist/src/lib/mappers/delegation.mapper.d.ts.map +1 -0
  6. package/dist/src/lib/mappers/file-access.mapper.d.ts +4 -0
  7. package/dist/src/lib/mappers/file-access.mapper.d.ts.map +1 -0
  8. package/dist/src/lib/mappers/file-category.mapper.d.ts +4 -0
  9. package/dist/src/lib/mappers/file-category.mapper.d.ts.map +1 -0
  10. package/dist/src/lib/mappers/file-tag.mapper.d.ts +4 -0
  11. package/dist/src/lib/mappers/file-tag.mapper.d.ts.map +1 -0
  12. package/dist/src/lib/mappers/index.d.ts +4 -0
  13. package/dist/src/lib/mappers/index.d.ts.map +1 -1
  14. package/dist/src/lib/services/delegations.service.d.ts +14 -0
  15. package/dist/src/lib/services/delegations.service.d.ts.map +1 -0
  16. package/dist/src/lib/services/file-access.service.d.ts +16 -0
  17. package/dist/src/lib/services/file-access.service.d.ts.map +1 -0
  18. package/dist/src/lib/services/file-categories.service.d.ts +14 -0
  19. package/dist/src/lib/services/file-categories.service.d.ts.map +1 -0
  20. package/dist/src/lib/services/file-tags.service.d.ts +15 -0
  21. package/dist/src/lib/services/file-tags.service.d.ts.map +1 -0
  22. package/dist/src/lib/services/index.d.ts +4 -0
  23. package/dist/src/lib/services/index.d.ts.map +1 -1
  24. package/dist/src/lib/types/delegation.d.ts +38 -0
  25. package/dist/src/lib/types/delegation.d.ts.map +1 -0
  26. package/dist/src/lib/types/file-access.d.ts +41 -0
  27. package/dist/src/lib/types/file-access.d.ts.map +1 -0
  28. package/dist/src/lib/types/file-category.d.ts +44 -0
  29. package/dist/src/lib/types/file-category.d.ts.map +1 -0
  30. package/dist/src/lib/types/file-tag.d.ts +41 -0
  31. package/dist/src/lib/types/file-tag.d.ts.map +1 -0
  32. package/dist/src/lib/types/index.d.ts +4 -0
  33. package/dist/src/lib/types/index.d.ts.map +1 -1
  34. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -695,12 +695,368 @@ function createUserFilesService(transport, _config) {
695
695
  };
696
696
  }
697
697
 
698
+ const fileCategoryMapper = {
699
+ type: 'FileCategory',
700
+ map: (resource)=>({
701
+ id: resource.id,
702
+ uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
703
+ createdAt: parseDate(resource.attributes['created_at']) || new Date(),
704
+ updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
705
+ code: parseString(resource.attributes['code']) || '',
706
+ name: parseString(resource.attributes['name']) || '',
707
+ description: parseString(resource.attributes['description']),
708
+ parentUniqueId: parseString(resource.attributes['parent_unique_id']),
709
+ color: parseString(resource.attributes['color']),
710
+ icon: parseString(resource.attributes['icon']),
711
+ sortOrder: parseOptionalNumber(resource.attributes['sort_order']),
712
+ status: parseStatus(resource.attributes['status']),
713
+ enabled: parseBoolean(resource.attributes['enabled']),
714
+ payload: resource.attributes['payload']
715
+ })
716
+ };
717
+
718
+ function createFileCategoriesService(transport, _config) {
719
+ return {
720
+ async list (params) {
721
+ const queryParams = {};
722
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
723
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
724
+ if (params == null ? void 0 : params.parentUniqueId) queryParams['parent_unique_id'] = params.parentUniqueId;
725
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
726
+ if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
727
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
728
+ const response = await transport.get('/categories', {
729
+ params: queryParams
730
+ });
731
+ return decodePageResult(response, fileCategoryMapper);
732
+ },
733
+ async get (uniqueId) {
734
+ const response = await transport.get(`/categories/${uniqueId}`);
735
+ return decodeOne(response, fileCategoryMapper);
736
+ },
737
+ async create (data) {
738
+ const response = await transport.post('/categories', {
739
+ category: {
740
+ code: data.code,
741
+ name: data.name,
742
+ description: data.description,
743
+ parent_unique_id: data.parentUniqueId,
744
+ color: data.color,
745
+ icon: data.icon,
746
+ sort_order: data.sortOrder,
747
+ payload: data.payload
748
+ }
749
+ });
750
+ return decodeOne(response, fileCategoryMapper);
751
+ },
752
+ async update (uniqueId, data) {
753
+ const response = await transport.put(`/categories/${uniqueId}`, {
754
+ category: {
755
+ name: data.name,
756
+ description: data.description,
757
+ parent_unique_id: data.parentUniqueId,
758
+ color: data.color,
759
+ icon: data.icon,
760
+ sort_order: data.sortOrder,
761
+ enabled: data.enabled,
762
+ status: data.status,
763
+ payload: data.payload
764
+ }
765
+ });
766
+ return decodeOne(response, fileCategoryMapper);
767
+ },
768
+ async delete (uniqueId) {
769
+ await transport.delete(`/categories/${uniqueId}`);
770
+ },
771
+ async listChildren (parentUniqueId) {
772
+ const response = await transport.get(`/categories/${parentUniqueId}/children`);
773
+ return decodeMany(response, fileCategoryMapper);
774
+ }
775
+ };
776
+ }
777
+
778
+ const fileTagMapper = {
779
+ type: 'FileTag',
780
+ map: (resource)=>({
781
+ id: resource.id,
782
+ uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
783
+ createdAt: parseDate(resource.attributes['created_at']) || new Date(),
784
+ updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
785
+ code: parseString(resource.attributes['code']) || '',
786
+ name: parseString(resource.attributes['name']) || '',
787
+ description: parseString(resource.attributes['description']),
788
+ color: parseString(resource.attributes['color']),
789
+ icon: parseString(resource.attributes['icon']),
790
+ status: parseStatus(resource.attributes['status']),
791
+ enabled: parseBoolean(resource.attributes['enabled']),
792
+ payload: resource.attributes['payload']
793
+ })
794
+ };
795
+
796
+ function createFileTagsService(transport, _config) {
797
+ return {
798
+ async list (params) {
799
+ const queryParams = {};
800
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
801
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
802
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
803
+ if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
804
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
805
+ const response = await transport.get('/tags', {
806
+ params: queryParams
807
+ });
808
+ return decodePageResult(response, fileTagMapper);
809
+ },
810
+ async get (uniqueId) {
811
+ const response = await transport.get(`/tags/${uniqueId}`);
812
+ return decodeOne(response, fileTagMapper);
813
+ },
814
+ async create (data) {
815
+ const response = await transport.post('/tags', {
816
+ tag: {
817
+ code: data.code,
818
+ name: data.name,
819
+ description: data.description,
820
+ color: data.color,
821
+ icon: data.icon,
822
+ payload: data.payload
823
+ }
824
+ });
825
+ return decodeOne(response, fileTagMapper);
826
+ },
827
+ async update (uniqueId, data) {
828
+ const response = await transport.put(`/tags/${uniqueId}`, {
829
+ tag: {
830
+ name: data.name,
831
+ description: data.description,
832
+ color: data.color,
833
+ icon: data.icon,
834
+ enabled: data.enabled,
835
+ status: data.status,
836
+ payload: data.payload
837
+ }
838
+ });
839
+ return decodeOne(response, fileTagMapper);
840
+ },
841
+ async delete (uniqueId) {
842
+ await transport.delete(`/tags/${uniqueId}`);
843
+ },
844
+ async addToFile (userUniqueId, fileUniqueId, tagUniqueId) {
845
+ await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/tags`, {
846
+ tag_unique_id: tagUniqueId
847
+ });
848
+ },
849
+ async removeFromFile (userUniqueId, fileUniqueId, tagUniqueId) {
850
+ await transport.delete(`/users/${userUniqueId}/files/${fileUniqueId}/tags/${tagUniqueId}`);
851
+ }
852
+ };
853
+ }
854
+
855
+ const fileDelegationMapper = {
856
+ type: 'FileDelegation',
857
+ map: (resource)=>({
858
+ id: resource.id,
859
+ uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
860
+ createdAt: parseDate(resource.attributes['created_at']) || new Date(),
861
+ updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
862
+ delegatorUniqueId: parseString(resource.attributes['delegator_unique_id']) || '',
863
+ delegateeUniqueId: parseString(resource.attributes['delegatee_unique_id']) || '',
864
+ fileUniqueId: parseString(resource.attributes['file_unique_id']),
865
+ folderUniqueId: parseString(resource.attributes['folder_unique_id']),
866
+ permissions: parseStringArray(resource.attributes['permissions']) || [],
867
+ expiresAt: parseDate(resource.attributes['expires_at']),
868
+ status: parseStatus(resource.attributes['status']),
869
+ enabled: parseBoolean(resource.attributes['enabled']),
870
+ payload: resource.attributes['payload']
871
+ })
872
+ };
873
+
874
+ function createDelegationsService(transport, _config) {
875
+ return {
876
+ async list (userUniqueId, params) {
877
+ const queryParams = {};
878
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
879
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
880
+ if (params == null ? void 0 : params.delegateeUniqueId) queryParams['delegatee_unique_id'] = params.delegateeUniqueId;
881
+ if (params == null ? void 0 : params.fileUniqueId) queryParams['file_unique_id'] = params.fileUniqueId;
882
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
883
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
884
+ const response = await transport.get(`/users/${userUniqueId}/delegations`, {
885
+ params: queryParams
886
+ });
887
+ return decodePageResult(response, fileDelegationMapper);
888
+ },
889
+ async get (userUniqueId, uniqueId) {
890
+ const response = await transport.get(`/users/${userUniqueId}/delegations/${uniqueId}`);
891
+ return decodeOne(response, fileDelegationMapper);
892
+ },
893
+ async create (userUniqueId, data) {
894
+ const response = await transport.post(`/users/${userUniqueId}/delegations`, {
895
+ delegation: {
896
+ delegatee_unique_id: data.delegateeUniqueId,
897
+ file_unique_id: data.fileUniqueId,
898
+ folder_unique_id: data.folderUniqueId,
899
+ permissions: data.permissions,
900
+ expires_at: data.expiresAt,
901
+ payload: data.payload
902
+ }
903
+ });
904
+ return decodeOne(response, fileDelegationMapper);
905
+ },
906
+ async update (userUniqueId, uniqueId, data) {
907
+ const response = await transport.put(`/users/${userUniqueId}/delegations/${uniqueId}`, {
908
+ delegation: {
909
+ permissions: data.permissions,
910
+ expires_at: data.expiresAt,
911
+ enabled: data.enabled,
912
+ status: data.status,
913
+ payload: data.payload
914
+ }
915
+ });
916
+ return decodeOne(response, fileDelegationMapper);
917
+ },
918
+ async delete (userUniqueId, uniqueId) {
919
+ await transport.delete(`/users/${userUniqueId}/delegations/${uniqueId}`);
920
+ },
921
+ async listReceivedDelegations (userUniqueId) {
922
+ const response = await transport.get(`/users/${userUniqueId}/delegations/received`);
923
+ return decodeMany(response, fileDelegationMapper);
924
+ }
925
+ };
926
+ }
927
+
928
+ function parseAccessLevel(value) {
929
+ const level = parseString(value);
930
+ if (level === 'read' || level === 'write' || level === 'admin') {
931
+ return level;
932
+ }
933
+ return 'read';
934
+ }
935
+ const fileAccessMapper = {
936
+ type: 'FileAccess',
937
+ map: (resource)=>({
938
+ id: resource.id,
939
+ uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
940
+ createdAt: parseDate(resource.attributes['created_at']) || new Date(),
941
+ updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
942
+ fileUniqueId: parseString(resource.attributes['file_unique_id']) || '',
943
+ granteeUniqueId: parseString(resource.attributes['grantee_unique_id']) || '',
944
+ granteeType: parseString(resource.attributes['grantee_type']) || '',
945
+ accessLevel: parseAccessLevel(resource.attributes['access_level']),
946
+ grantedByUniqueId: parseString(resource.attributes['granted_by_unique_id']) || '',
947
+ expiresAt: parseDate(resource.attributes['expires_at']),
948
+ accessedAt: parseDate(resource.attributes['accessed_at']),
949
+ accessCount: parseNumber(resource.attributes['access_count']),
950
+ status: parseStatus(resource.attributes['status']),
951
+ enabled: parseBoolean(resource.attributes['enabled']),
952
+ payload: resource.attributes['payload']
953
+ })
954
+ };
955
+
956
+ function createFileAccessService(transport, _config) {
957
+ return {
958
+ async list (params) {
959
+ const queryParams = {};
960
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
961
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
962
+ if (params == null ? void 0 : params.fileUniqueId) queryParams['file_unique_id'] = params.fileUniqueId;
963
+ if (params == null ? void 0 : params.granteeUniqueId) queryParams['grantee_unique_id'] = params.granteeUniqueId;
964
+ if (params == null ? void 0 : params.granteeType) queryParams['grantee_type'] = params.granteeType;
965
+ if (params == null ? void 0 : params.accessLevel) queryParams['access_level'] = params.accessLevel;
966
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
967
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
968
+ const response = await transport.get('/file_accesses', {
969
+ params: queryParams
970
+ });
971
+ return decodePageResult(response, fileAccessMapper);
972
+ },
973
+ async get (uniqueId) {
974
+ const response = await transport.get(`/file_accesses/${uniqueId}`);
975
+ return decodeOne(response, fileAccessMapper);
976
+ },
977
+ async grant (data) {
978
+ const response = await transport.post('/file_accesses', {
979
+ file_access: {
980
+ file_unique_id: data.fileUniqueId,
981
+ grantee_unique_id: data.granteeUniqueId,
982
+ grantee_type: data.granteeType,
983
+ access_level: data.accessLevel,
984
+ expires_at: data.expiresAt,
985
+ payload: data.payload
986
+ }
987
+ });
988
+ return decodeOne(response, fileAccessMapper);
989
+ },
990
+ async update (uniqueId, data) {
991
+ const response = await transport.put(`/file_accesses/${uniqueId}`, {
992
+ file_access: {
993
+ access_level: data.accessLevel,
994
+ expires_at: data.expiresAt,
995
+ enabled: data.enabled,
996
+ status: data.status,
997
+ payload: data.payload
998
+ }
999
+ });
1000
+ return decodeOne(response, fileAccessMapper);
1001
+ },
1002
+ async revoke (uniqueId) {
1003
+ await transport.delete(`/file_accesses/${uniqueId}`);
1004
+ },
1005
+ async listByFile (fileUniqueId, params) {
1006
+ const queryParams = {
1007
+ file_unique_id: fileUniqueId
1008
+ };
1009
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
1010
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
1011
+ if (params == null ? void 0 : params.accessLevel) queryParams['access_level'] = params.accessLevel;
1012
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
1013
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
1014
+ const response = await transport.get('/file_accesses', {
1015
+ params: queryParams
1016
+ });
1017
+ return decodePageResult(response, fileAccessMapper);
1018
+ },
1019
+ async listByGrantee (granteeUniqueId, granteeType, params) {
1020
+ const queryParams = {
1021
+ grantee_unique_id: granteeUniqueId,
1022
+ grantee_type: granteeType
1023
+ };
1024
+ if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
1025
+ if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
1026
+ if (params == null ? void 0 : params.accessLevel) queryParams['access_level'] = params.accessLevel;
1027
+ if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
1028
+ if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
1029
+ const response = await transport.get('/file_accesses', {
1030
+ params: queryParams
1031
+ });
1032
+ return decodePageResult(response, fileAccessMapper);
1033
+ },
1034
+ async checkAccess (fileUniqueId, granteeUniqueId) {
1035
+ try {
1036
+ const response = await transport.get('/file_accesses/check', {
1037
+ params: {
1038
+ file_unique_id: fileUniqueId,
1039
+ grantee_unique_id: granteeUniqueId
1040
+ }
1041
+ });
1042
+ return decodeOne(response, fileAccessMapper);
1043
+ } catch (e) {
1044
+ return null;
1045
+ }
1046
+ }
1047
+ };
1048
+ }
1049
+
698
1050
  function createFilesBlock(transport, config) {
699
1051
  return {
700
1052
  storageFiles: createStorageFilesService(transport),
701
1053
  entityFiles: createEntityFilesService(transport),
702
1054
  fileSchemas: createFileSchemasService(transport),
703
- userFiles: createUserFilesService(transport)
1055
+ userFiles: createUserFilesService(transport),
1056
+ fileCategories: createFileCategoriesService(transport),
1057
+ fileTags: createFileTagsService(transport),
1058
+ delegations: createDelegationsService(transport),
1059
+ fileAccess: createFileAccessService(transport)
704
1060
  };
705
1061
  }
706
1062
  const filesBlockMetadata = {
@@ -711,8 +1067,12 @@ const filesBlockMetadata = {
711
1067
  'StorageFile',
712
1068
  'EntityFile',
713
1069
  'FileSchema',
714
- 'UserFile'
1070
+ 'UserFile',
1071
+ 'FileCategory',
1072
+ 'FileTag',
1073
+ 'FileDelegation',
1074
+ 'FileAccess'
715
1075
  ]
716
1076
  };
717
1077
 
718
- export { createEntityFilesService, createFileSchemasService, createFilesBlock, createStorageFilesService, createUserFilesService, entityFileMapper, fileSchemaMapper, filesBlockMetadata, parseBoolean, parseDate, parseNumber, parseOptionalNumber, parseStatus, parseString, parseStringArray, storageFileMapper, userFileMapper };
1078
+ export { createDelegationsService, createEntityFilesService, createFileAccessService, createFileCategoriesService, createFileSchemasService, createFileTagsService, createFilesBlock, createStorageFilesService, createUserFilesService, entityFileMapper, fileAccessMapper, fileCategoryMapper, fileDelegationMapper, fileSchemaMapper, fileTagMapper, filesBlockMetadata, parseBoolean, parseDate, parseNumber, parseOptionalNumber, parseStatus, parseString, parseStringArray, storageFileMapper, userFileMapper };
@@ -1,5 +1,5 @@
1
1
  import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
2
- import { type StorageFilesService, type EntityFilesService, type FileSchemasService, type UserFilesService } from './services';
2
+ import { type StorageFilesService, type EntityFilesService, type FileSchemasService, type UserFilesService, type FileCategoriesService, type FileTagsService, type DelegationsService, type FileAccessService } from './services';
3
3
  export interface FilesBlockConfig extends BlockConfig {
4
4
  appId: string;
5
5
  tenantId?: string;
@@ -9,6 +9,10 @@ export interface FilesBlock {
9
9
  entityFiles: EntityFilesService;
10
10
  fileSchemas: FileSchemasService;
11
11
  userFiles: UserFilesService;
12
+ fileCategories: FileCategoriesService;
13
+ fileTags: FileTagsService;
14
+ delegations: DelegationsService;
15
+ fileAccess: FileAccessService;
12
16
  }
13
17
  export declare function createFilesBlock(transport: Transport, config: FilesBlockConfig): FilesBlock;
14
18
  export declare const filesBlockMetadata: BlockMetadata;
@@ -1 +1 @@
1
- {"version":3,"file":"files.block.d.ts","sourceRoot":"","sources":["../../../src/lib/files.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,mBAAmB,CAAC;IAClC,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,GACvB,UAAU,CAOZ;AAED,eAAO,MAAM,kBAAkB,EAAE,aAUhC,CAAC"}
1
+ {"version":3,"file":"files.block.d.ts","sourceRoot":"","sources":["../../../src/lib/files.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,mBAAmB,CAAC;IAClC,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,cAAc,EAAE,qBAAqB,CAAC;IACtC,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,GACvB,UAAU,CAWZ;AAED,eAAO,MAAM,kBAAkB,EAAE,aAchC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ResourceMapper } from '@23blocks/jsonapi-codec';
2
+ import type { FileDelegation } from '../types/delegation';
3
+ export declare const fileDelegationMapper: ResourceMapper<FileDelegation>;
4
+ //# sourceMappingURL=delegation.mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/delegation.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAkB/D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ResourceMapper } from '@23blocks/jsonapi-codec';
2
+ import type { FileAccess } from '../types/file-access';
3
+ export declare const fileAccessMapper: ResourceMapper<FileAccess>;
4
+ //# sourceMappingURL=file-access.mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-access.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/file-access.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAWvD,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,UAAU,CAoBvD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ResourceMapper } from '@23blocks/jsonapi-codec';
2
+ import type { FileCategory } from '../types/file-category';
3
+ export declare const fileCategoryMapper: ResourceMapper<FileCategory>;
4
+ //# sourceMappingURL=file-category.mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-category.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/file-category.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAmB3D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ResourceMapper } from '@23blocks/jsonapi-codec';
2
+ import type { FileTag } from '../types/file-tag';
3
+ export declare const fileTagMapper: ResourceMapper<FileTag>;
4
+ //# sourceMappingURL=file-tag.mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tag.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/file-tag.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,OAAO,CAiBjD,CAAC"}
@@ -2,5 +2,9 @@ export * from './storage-file.mapper';
2
2
  export * from './entity-file.mapper';
3
3
  export * from './file-schema.mapper';
4
4
  export * from './user-file.mapper';
5
+ export * from './file-category.mapper';
6
+ export * from './file-tag.mapper';
7
+ export * from './delegation.mapper';
8
+ export * from './file-access.mapper';
5
9
  export * from './utils';
6
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Transport, PageResult } from '@23blocks/contracts';
2
+ import type { FileDelegation, CreateFileDelegationRequest, UpdateFileDelegationRequest, ListFileDelegationsParams } from '../types/delegation';
3
+ export interface DelegationsService {
4
+ list(userUniqueId: string, params?: ListFileDelegationsParams): Promise<PageResult<FileDelegation>>;
5
+ get(userUniqueId: string, uniqueId: string): Promise<FileDelegation>;
6
+ create(userUniqueId: string, data: CreateFileDelegationRequest): Promise<FileDelegation>;
7
+ update(userUniqueId: string, uniqueId: string, data: UpdateFileDelegationRequest): Promise<FileDelegation>;
8
+ delete(userUniqueId: string, uniqueId: string): Promise<void>;
9
+ listReceivedDelegations(userUniqueId: string): Promise<FileDelegation[]>;
10
+ }
11
+ export declare function createDelegationsService(transport: Transport, _config: {
12
+ appId: string;
13
+ }): DelegationsService;
14
+ //# sourceMappingURL=delegations.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegations.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/delegations.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IACpG,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACrE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACzF,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3G,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC1E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAwD7G"}
@@ -0,0 +1,16 @@
1
+ import type { Transport, PageResult } from '@23blocks/contracts';
2
+ import type { FileAccess, CreateFileAccessRequest, UpdateFileAccessRequest, ListFileAccessParams } from '../types/file-access';
3
+ export interface FileAccessService {
4
+ list(params?: ListFileAccessParams): Promise<PageResult<FileAccess>>;
5
+ get(uniqueId: string): Promise<FileAccess>;
6
+ grant(data: CreateFileAccessRequest): Promise<FileAccess>;
7
+ update(uniqueId: string, data: UpdateFileAccessRequest): Promise<FileAccess>;
8
+ revoke(uniqueId: string): Promise<void>;
9
+ listByFile(fileUniqueId: string, params?: ListFileAccessParams): Promise<PageResult<FileAccess>>;
10
+ listByGrantee(granteeUniqueId: string, granteeType: string, params?: ListFileAccessParams): Promise<PageResult<FileAccess>>;
11
+ checkAccess(fileUniqueId: string, granteeUniqueId: string): Promise<FileAccess | null>;
12
+ }
13
+ export declare function createFileAccessService(transport: Transport, _config: {
14
+ appId: string;
15
+ }): FileAccessService;
16
+ //# sourceMappingURL=file-access.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-access.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/file-access.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,KAAK,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7E,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,aAAa,CAAC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5H,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACxF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAgG3G"}
@@ -0,0 +1,14 @@
1
+ import type { Transport, PageResult } from '@23blocks/contracts';
2
+ import type { FileCategory, CreateFileCategoryRequest, UpdateFileCategoryRequest, ListFileCategoriesParams } from '../types/file-category';
3
+ export interface FileCategoriesService {
4
+ list(params?: ListFileCategoriesParams): Promise<PageResult<FileCategory>>;
5
+ get(uniqueId: string): Promise<FileCategory>;
6
+ create(data: CreateFileCategoryRequest): Promise<FileCategory>;
7
+ update(uniqueId: string, data: UpdateFileCategoryRequest): Promise<FileCategory>;
8
+ delete(uniqueId: string): Promise<void>;
9
+ listChildren(parentUniqueId: string): Promise<FileCategory[]>;
10
+ }
11
+ export declare function createFileCategoriesService(transport: Transport, _config: {
12
+ appId: string;
13
+ }): FileCategoriesService;
14
+ //# sourceMappingURL=file-categories.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-categories.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/file-categories.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACjF,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC/D;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CA8DnH"}
@@ -0,0 +1,15 @@
1
+ import type { Transport, PageResult } from '@23blocks/contracts';
2
+ import type { FileTag, CreateFileTagRequest, UpdateFileTagRequest, ListFileTagsParams } from '../types/file-tag';
3
+ export interface FileTagsService {
4
+ list(params?: ListFileTagsParams): Promise<PageResult<FileTag>>;
5
+ get(uniqueId: string): Promise<FileTag>;
6
+ create(data: CreateFileTagRequest): Promise<FileTag>;
7
+ update(uniqueId: string, data: UpdateFileTagRequest): Promise<FileTag>;
8
+ delete(uniqueId: string): Promise<void>;
9
+ addToFile(userUniqueId: string, fileUniqueId: string, tagUniqueId: string): Promise<void>;
10
+ removeFromFile(userUniqueId: string, fileUniqueId: string, tagUniqueId: string): Promise<void>;
11
+ }
12
+ export declare function createFileTagsService(transport: Transport, _config: {
13
+ appId: string;
14
+ }): FileTagsService;
15
+ //# sourceMappingURL=file-tags.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tags.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/file-tags.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChG;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CA8DvG"}
@@ -2,4 +2,8 @@ export * from './storage-files.service';
2
2
  export * from './entity-files.service';
3
3
  export * from './file-schemas.service';
4
4
  export * from './user-files.service';
5
+ export * from './file-categories.service';
6
+ export * from './file-tags.service';
7
+ export * from './delegations.service';
8
+ export * from './file-access.service';
5
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
2
+ export interface FileDelegation extends IdentityCore {
3
+ delegatorUniqueId: string;
4
+ delegateeUniqueId: string;
5
+ fileUniqueId?: string;
6
+ folderUniqueId?: string;
7
+ permissions: string[];
8
+ expiresAt?: Date;
9
+ status: EntityStatus;
10
+ enabled: boolean;
11
+ payload?: Record<string, unknown>;
12
+ }
13
+ export interface CreateFileDelegationRequest {
14
+ delegateeUniqueId: string;
15
+ fileUniqueId?: string;
16
+ folderUniqueId?: string;
17
+ permissions: string[];
18
+ expiresAt?: string;
19
+ payload?: Record<string, unknown>;
20
+ }
21
+ export interface UpdateFileDelegationRequest {
22
+ permissions?: string[];
23
+ expiresAt?: string;
24
+ enabled?: boolean;
25
+ status?: EntityStatus;
26
+ payload?: Record<string, unknown>;
27
+ }
28
+ export interface ListFileDelegationsParams {
29
+ page?: number;
30
+ perPage?: number;
31
+ delegatorUniqueId?: string;
32
+ delegateeUniqueId?: string;
33
+ fileUniqueId?: string;
34
+ status?: EntityStatus;
35
+ sortBy?: string;
36
+ sortOrder?: 'asc' | 'desc';
37
+ }
38
+ //# sourceMappingURL=delegation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/delegation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,41 @@
1
+ import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
2
+ export interface FileAccess extends IdentityCore {
3
+ fileUniqueId: string;
4
+ granteeUniqueId: string;
5
+ granteeType: string;
6
+ accessLevel: 'read' | 'write' | 'admin';
7
+ grantedByUniqueId: string;
8
+ expiresAt?: Date;
9
+ accessedAt?: Date;
10
+ accessCount: number;
11
+ status: EntityStatus;
12
+ enabled: boolean;
13
+ payload?: Record<string, unknown>;
14
+ }
15
+ export interface CreateFileAccessRequest {
16
+ fileUniqueId: string;
17
+ granteeUniqueId: string;
18
+ granteeType: string;
19
+ accessLevel?: 'read' | 'write' | 'admin';
20
+ expiresAt?: string;
21
+ payload?: Record<string, unknown>;
22
+ }
23
+ export interface UpdateFileAccessRequest {
24
+ accessLevel?: 'read' | 'write' | 'admin';
25
+ expiresAt?: string;
26
+ enabled?: boolean;
27
+ status?: EntityStatus;
28
+ payload?: Record<string, unknown>;
29
+ }
30
+ export interface ListFileAccessParams {
31
+ page?: number;
32
+ perPage?: number;
33
+ fileUniqueId?: string;
34
+ granteeUniqueId?: string;
35
+ granteeType?: string;
36
+ accessLevel?: 'read' | 'write' | 'admin';
37
+ status?: EntityStatus;
38
+ sortBy?: string;
39
+ sortOrder?: 'asc' | 'desc';
40
+ }
41
+ //# sourceMappingURL=file-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-access.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/file-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACxC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,44 @@
1
+ import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
2
+ export interface FileCategory extends IdentityCore {
3
+ code: string;
4
+ name: string;
5
+ description?: string;
6
+ parentUniqueId?: string;
7
+ color?: string;
8
+ icon?: string;
9
+ sortOrder?: number;
10
+ status: EntityStatus;
11
+ enabled: boolean;
12
+ payload?: Record<string, unknown>;
13
+ }
14
+ export interface CreateFileCategoryRequest {
15
+ code: string;
16
+ name: string;
17
+ description?: string;
18
+ parentUniqueId?: string;
19
+ color?: string;
20
+ icon?: string;
21
+ sortOrder?: number;
22
+ payload?: Record<string, unknown>;
23
+ }
24
+ export interface UpdateFileCategoryRequest {
25
+ name?: string;
26
+ description?: string;
27
+ parentUniqueId?: string;
28
+ color?: string;
29
+ icon?: string;
30
+ sortOrder?: number;
31
+ enabled?: boolean;
32
+ status?: EntityStatus;
33
+ payload?: Record<string, unknown>;
34
+ }
35
+ export interface ListFileCategoriesParams {
36
+ page?: number;
37
+ perPage?: number;
38
+ parentUniqueId?: string;
39
+ status?: EntityStatus;
40
+ search?: string;
41
+ sortBy?: string;
42
+ sortOrder?: 'asc' | 'desc';
43
+ }
44
+ //# sourceMappingURL=file-category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-category.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/file-category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,41 @@
1
+ import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
2
+ export interface FileTag extends IdentityCore {
3
+ code: string;
4
+ name: string;
5
+ description?: string;
6
+ color?: string;
7
+ icon?: string;
8
+ status: EntityStatus;
9
+ enabled: boolean;
10
+ payload?: Record<string, unknown>;
11
+ }
12
+ export interface CreateFileTagRequest {
13
+ code: string;
14
+ name: string;
15
+ description?: string;
16
+ color?: string;
17
+ icon?: string;
18
+ payload?: Record<string, unknown>;
19
+ }
20
+ export interface UpdateFileTagRequest {
21
+ name?: string;
22
+ description?: string;
23
+ color?: string;
24
+ icon?: string;
25
+ enabled?: boolean;
26
+ status?: EntityStatus;
27
+ payload?: Record<string, unknown>;
28
+ }
29
+ export interface ListFileTagsParams {
30
+ page?: number;
31
+ perPage?: number;
32
+ status?: EntityStatus;
33
+ search?: string;
34
+ sortBy?: string;
35
+ sortOrder?: 'asc' | 'desc';
36
+ }
37
+ export interface FileTagAssignment {
38
+ fileUniqueId: string;
39
+ tagUniqueId: string;
40
+ }
41
+ //# sourceMappingURL=file-tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tag.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/file-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -2,4 +2,8 @@ export * from './storage-file';
2
2
  export * from './entity-file';
3
3
  export * from './file-schema';
4
4
  export * from './user-file';
5
+ export * from './file-category';
6
+ export * from './file-tag';
7
+ export * from './delegation';
8
+ export * from './file-access';
5
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@23blocks/block-files",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "description": "Files block for 23blocks SDK - storage, upload, download, file management",
5
5
  "license": "MIT",
6
6
  "author": "23blocks <hello@23blocks.com>",