@magda/connector-sdk 3.0.0-alpha.0 → 3.0.0-alpha.2
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/dist/index.d.ts +34 -47
- package/dist/index.js +29295 -63150
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
import http from 'node:http';
|
|
4
1
|
import { default as URI_2 } from 'urijs';
|
|
5
2
|
|
|
6
3
|
export declare interface AspectBuilder {
|
|
@@ -36,10 +33,8 @@ export declare class AspectDefinition {
|
|
|
36
33
|
declare class AspectDefinitionsApi {
|
|
37
34
|
protected basePath: string;
|
|
38
35
|
protected defaultHeaders: any;
|
|
39
|
-
protected _useQuerystring: boolean;
|
|
40
36
|
protected authentications: any;
|
|
41
37
|
constructor(basePath?: string);
|
|
42
|
-
set useQuerystring(value: boolean);
|
|
43
38
|
setApiKey(key: AspectDefinitionsApiApiKeys, value: string): void;
|
|
44
39
|
/**
|
|
45
40
|
* Create a new aspect
|
|
@@ -49,7 +44,7 @@ declare class AspectDefinitionsApi {
|
|
|
49
44
|
* @param xMagdaSession Magda internal session id
|
|
50
45
|
*/
|
|
51
46
|
create(xMagdaTenantId: number, aspect: AspectDefinition, xMagdaSession: string): Promise<{
|
|
52
|
-
response:
|
|
47
|
+
response: Response;
|
|
53
48
|
body: AspectDefinition;
|
|
54
49
|
}>;
|
|
55
50
|
/**
|
|
@@ -59,7 +54,7 @@ declare class AspectDefinitionsApi {
|
|
|
59
54
|
* @param xMagdaSession Magda internal session id
|
|
60
55
|
*/
|
|
61
56
|
getAll(xMagdaTenantId: number, xMagdaSession?: string): Promise<{
|
|
62
|
-
response:
|
|
57
|
+
response: Response;
|
|
63
58
|
body: Array<AspectDefinition>;
|
|
64
59
|
}>;
|
|
65
60
|
/**
|
|
@@ -70,7 +65,7 @@ declare class AspectDefinitionsApi {
|
|
|
70
65
|
* @param xMagdaSession Magda internal session id
|
|
71
66
|
*/
|
|
72
67
|
getById(xMagdaTenantId: number, id: string, xMagdaSession?: string): Promise<{
|
|
73
|
-
response:
|
|
68
|
+
response: Response;
|
|
74
69
|
body: AspectDefinition;
|
|
75
70
|
}>;
|
|
76
71
|
/**
|
|
@@ -82,7 +77,7 @@ declare class AspectDefinitionsApi {
|
|
|
82
77
|
* @param xMagdaSession Magda internal session id
|
|
83
78
|
*/
|
|
84
79
|
patchById(xMagdaTenantId: number, id: string, aspectPatch: Array<Operation>, xMagdaSession: string): Promise<{
|
|
85
|
-
response:
|
|
80
|
+
response: Response;
|
|
86
81
|
body: AspectDefinition;
|
|
87
82
|
}>;
|
|
88
83
|
/**
|
|
@@ -94,7 +89,7 @@ declare class AspectDefinitionsApi {
|
|
|
94
89
|
* @param xMagdaSession Magda internal session id
|
|
95
90
|
*/
|
|
96
91
|
putById(xMagdaTenantId: number, id: string, aspect: AspectDefinition, xMagdaSession: string): Promise<{
|
|
97
|
-
response:
|
|
92
|
+
response: Response;
|
|
98
93
|
body: AspectDefinition;
|
|
99
94
|
}>;
|
|
100
95
|
}
|
|
@@ -662,10 +657,8 @@ export { Record_2 as Record }
|
|
|
662
657
|
declare class RecordAspectsApi {
|
|
663
658
|
protected basePath: string;
|
|
664
659
|
protected defaultHeaders: any;
|
|
665
|
-
protected _useQuerystring: boolean;
|
|
666
660
|
protected authentications: any;
|
|
667
661
|
constructor(basePath?: string);
|
|
668
|
-
set useQuerystring(value: boolean);
|
|
669
662
|
setApiKey(key: RecordAspectsApiApiKeys, value: string): void;
|
|
670
663
|
/**
|
|
671
664
|
* Delete a record aspect by ID
|
|
@@ -676,7 +669,7 @@ declare class RecordAspectsApi {
|
|
|
676
669
|
* @param xMagdaTenantId 0
|
|
677
670
|
*/
|
|
678
671
|
deleteById(recordId: string, aspectId: string, xMagdaSession: string, xMagdaTenantId: number): Promise<{
|
|
679
|
-
response:
|
|
672
|
+
response: Response;
|
|
680
673
|
body: DeleteResult;
|
|
681
674
|
}>;
|
|
682
675
|
/**
|
|
@@ -691,7 +684,7 @@ declare class RecordAspectsApi {
|
|
|
691
684
|
* @param xMagdaSession Magda internal session id
|
|
692
685
|
*/
|
|
693
686
|
getAspects(xMagdaTenantId: number, recordId: string, keyword?: string, aspectIdOnly?: boolean, start?: number, limit?: number, xMagdaSession?: string): Promise<{
|
|
694
|
-
response:
|
|
687
|
+
response: Response;
|
|
695
688
|
body: Array<any>;
|
|
696
689
|
}>;
|
|
697
690
|
/**
|
|
@@ -703,7 +696,7 @@ declare class RecordAspectsApi {
|
|
|
703
696
|
* @param xMagdaSession Magda internal session id
|
|
704
697
|
*/
|
|
705
698
|
getAspectsCount(xMagdaTenantId: number, recordId: string, keyword?: string, xMagdaSession?: string): Promise<{
|
|
706
|
-
response:
|
|
699
|
+
response: Response;
|
|
707
700
|
body: CountResponse;
|
|
708
701
|
}>;
|
|
709
702
|
/**
|
|
@@ -715,7 +708,7 @@ declare class RecordAspectsApi {
|
|
|
715
708
|
* @param xMagdaSession Magda internal session id
|
|
716
709
|
*/
|
|
717
710
|
getById(xMagdaTenantId: number, recordId: string, aspectId: string, xMagdaSession?: string): Promise<{
|
|
718
|
-
response:
|
|
711
|
+
response: Response;
|
|
719
712
|
body: any;
|
|
720
713
|
}>;
|
|
721
714
|
/**
|
|
@@ -728,7 +721,7 @@ declare class RecordAspectsApi {
|
|
|
728
721
|
* @param xMagdaTenantId 0
|
|
729
722
|
*/
|
|
730
723
|
patchById(recordId: string, aspectId: string, aspectPatch: Array<Operation>, xMagdaSession: string, xMagdaTenantId: number): Promise<{
|
|
731
|
-
response:
|
|
724
|
+
response: Response;
|
|
732
725
|
body: any;
|
|
733
726
|
}>;
|
|
734
727
|
/**
|
|
@@ -742,7 +735,7 @@ declare class RecordAspectsApi {
|
|
|
742
735
|
* @param merge Whether merge the supplied aspect data to existing aspect data or replace it
|
|
743
736
|
*/
|
|
744
737
|
putById(recordId: string, aspectId: string, aspect: any, xMagdaSession: string, xMagdaTenantId: number, merge?: boolean): Promise<{
|
|
745
|
-
response:
|
|
738
|
+
response: Response;
|
|
746
739
|
body: any;
|
|
747
740
|
}>;
|
|
748
741
|
}
|
|
@@ -762,10 +755,8 @@ declare type RecordFilterFunctionType = (jsonData: any, type: "Dataset" | "Distr
|
|
|
762
755
|
declare class RecordHistoryApi {
|
|
763
756
|
protected basePath: string;
|
|
764
757
|
protected defaultHeaders: any;
|
|
765
|
-
protected _useQuerystring: boolean;
|
|
766
758
|
protected authentications: any;
|
|
767
759
|
constructor(basePath?: string);
|
|
768
|
-
set useQuerystring(value: boolean);
|
|
769
760
|
setApiKey(key: RecordHistoryApiApiKeys, value: string): void;
|
|
770
761
|
/**
|
|
771
762
|
* Get a list of all events affecting this record
|
|
@@ -781,7 +772,7 @@ declare class RecordHistoryApi {
|
|
|
781
772
|
* @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to `true`, higher pageToken records (newer records) will be returned.
|
|
782
773
|
*/
|
|
783
774
|
history(xMagdaTenantId: number, recordId: string, xMagdaSession: string, pageToken?: string, start?: number, limit?: number, aspect?: Array<string>, dereference?: boolean, reversePageTokenOrder?: boolean): Promise<{
|
|
784
|
-
response:
|
|
775
|
+
response: Response;
|
|
785
776
|
body: EventsPage;
|
|
786
777
|
}>;
|
|
787
778
|
/**
|
|
@@ -792,7 +783,7 @@ declare class RecordHistoryApi {
|
|
|
792
783
|
* @param eventId The ID of the last event to be applied to the record. The event with this ID need not actually apply to the record, in which case that last event prior to this even that does apply will be used.
|
|
793
784
|
*/
|
|
794
785
|
version(xMagdaTenantId: number, recordId: string, eventId: string): Promise<{
|
|
795
|
-
response:
|
|
786
|
+
response: Response;
|
|
796
787
|
body: Record_2;
|
|
797
788
|
}>;
|
|
798
789
|
}
|
|
@@ -803,10 +794,8 @@ declare enum RecordHistoryApiApiKeys {
|
|
|
803
794
|
declare class RecordsApi {
|
|
804
795
|
protected basePath: string;
|
|
805
796
|
protected defaultHeaders: any;
|
|
806
|
-
protected _useQuerystring: boolean;
|
|
807
797
|
protected authentications: any;
|
|
808
798
|
constructor(basePath?: string);
|
|
809
|
-
set useQuerystring(value: boolean);
|
|
810
799
|
setApiKey(key: RecordsApiApiKeys, value: string): void;
|
|
811
800
|
/**
|
|
812
801
|
* Create a new record
|
|
@@ -816,7 +805,7 @@ declare class RecordsApi {
|
|
|
816
805
|
* @param xMagdaSession Magda internal session id
|
|
817
806
|
*/
|
|
818
807
|
create(xMagdaTenantId: number, record: Record_2, xMagdaSession: string): Promise<{
|
|
819
|
-
response:
|
|
808
|
+
response: Response;
|
|
820
809
|
body: Record_2;
|
|
821
810
|
}>;
|
|
822
811
|
/**
|
|
@@ -827,7 +816,7 @@ declare class RecordsApi {
|
|
|
827
816
|
* @param xMagdaSession Magda internal session id
|
|
828
817
|
*/
|
|
829
818
|
deleteById(xMagdaTenantId: number, recordId: string, xMagdaSession: string): Promise<{
|
|
830
|
-
response:
|
|
819
|
+
response: Response;
|
|
831
820
|
body: DeleteResult;
|
|
832
821
|
}>;
|
|
833
822
|
/**
|
|
@@ -839,7 +828,7 @@ declare class RecordsApi {
|
|
|
839
828
|
* @param xMagdaSession Magda internal session id
|
|
840
829
|
*/
|
|
841
830
|
deleteRecordsAspectArrayItems(xMagdaTenantId: number, aspectId: string, requestData: DeleteRecordsAspectArrayItemsRequest, xMagdaSession: string): Promise<{
|
|
842
|
-
response:
|
|
831
|
+
response: Response;
|
|
843
832
|
body: Array<any>;
|
|
844
833
|
}>;
|
|
845
834
|
/**
|
|
@@ -862,7 +851,7 @@ declare class RecordsApi {
|
|
|
862
851
|
* @param xMagdaSession Magda internal session id
|
|
863
852
|
*/
|
|
864
853
|
getAll(xMagdaTenantId: number, aspect?: Array<string>, optionalAspect?: Array<string>, pageToken?: string, start?: number, limit?: number, dereference?: boolean, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, orderBy?: string, orderByDir?: string, orderNullFirst?: boolean, reversePageTokenOrder?: boolean, q?: string, xMagdaSession?: string): Promise<{
|
|
865
|
-
response:
|
|
854
|
+
response: Response;
|
|
866
855
|
body: Array<Record_2>;
|
|
867
856
|
}>;
|
|
868
857
|
/**
|
|
@@ -877,7 +866,7 @@ declare class RecordsApi {
|
|
|
877
866
|
* @param xMagdaSession Magda internal session id
|
|
878
867
|
*/
|
|
879
868
|
getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, reversePageTokenOrder?: boolean, q?: string, xMagdaSession?: string): Promise<{
|
|
880
|
-
response:
|
|
869
|
+
response: Response;
|
|
881
870
|
body: Array<RecordSummary>;
|
|
882
871
|
}>;
|
|
883
872
|
/**
|
|
@@ -891,7 +880,7 @@ declare class RecordsApi {
|
|
|
891
880
|
* @param xMagdaSession Magda internal session id
|
|
892
881
|
*/
|
|
893
882
|
getById(id: string, xMagdaTenantId: number, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean, xMagdaSession?: string): Promise<{
|
|
894
|
-
response:
|
|
883
|
+
response: Response;
|
|
895
884
|
body: Record_2;
|
|
896
885
|
}>;
|
|
897
886
|
/**
|
|
@@ -902,7 +891,7 @@ declare class RecordsApi {
|
|
|
902
891
|
* @param xMagdaSession Magda internal session id
|
|
903
892
|
*/
|
|
904
893
|
getByIdInFull(id: string, xMagdaTenantId: number, xMagdaSession?: string): Promise<{
|
|
905
|
-
response:
|
|
894
|
+
response: Response;
|
|
906
895
|
body: Record_2;
|
|
907
896
|
}>;
|
|
908
897
|
/**
|
|
@@ -913,7 +902,7 @@ declare class RecordsApi {
|
|
|
913
902
|
* @param xMagdaSession Magda internal session id
|
|
914
903
|
*/
|
|
915
904
|
getByIdSummary(id: string, xMagdaTenantId: number, xMagdaSession?: string): Promise<{
|
|
916
|
-
response:
|
|
905
|
+
response: Response;
|
|
917
906
|
body: RecordSummary;
|
|
918
907
|
}>;
|
|
919
908
|
/**
|
|
@@ -927,7 +916,7 @@ declare class RecordsApi {
|
|
|
927
916
|
* @param xMagdaSession Magda internal session id
|
|
928
917
|
*/
|
|
929
918
|
getCount(xMagdaTenantId: number, aspect?: Array<string>, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, q?: string, xMagdaSession?: string): Promise<{
|
|
930
|
-
response:
|
|
919
|
+
response: Response;
|
|
931
920
|
body: CountResponse;
|
|
932
921
|
}>;
|
|
933
922
|
/**
|
|
@@ -939,7 +928,7 @@ declare class RecordsApi {
|
|
|
939
928
|
* @param xMagdaSession Magda internal session id
|
|
940
929
|
*/
|
|
941
930
|
getPageTokens(xMagdaTenantId: number, aspect?: Array<string>, limit?: number, xMagdaSession?: string): Promise<{
|
|
942
|
-
response:
|
|
931
|
+
response: Response;
|
|
943
932
|
body: Array<string>;
|
|
944
933
|
}>;
|
|
945
934
|
/**
|
|
@@ -951,7 +940,7 @@ declare class RecordsApi {
|
|
|
951
940
|
* @param xMagdaSession Magda internal session id
|
|
952
941
|
*/
|
|
953
942
|
patchById(xMagdaTenantId: number, id: string, recordPatch: Array<Operation>, xMagdaSession: string): Promise<{
|
|
954
|
-
response:
|
|
943
|
+
response: Response;
|
|
955
944
|
body: Record_2;
|
|
956
945
|
}>;
|
|
957
946
|
/**
|
|
@@ -962,7 +951,7 @@ declare class RecordsApi {
|
|
|
962
951
|
* @param xMagdaSession Magda internal session id
|
|
963
952
|
*/
|
|
964
953
|
patchRecords(xMagdaTenantId: number, requestData: PatchRecordsRequest, xMagdaSession: string): Promise<{
|
|
965
|
-
response:
|
|
954
|
+
response: Response;
|
|
966
955
|
body: Array<any>;
|
|
967
956
|
}>;
|
|
968
957
|
/**
|
|
@@ -975,7 +964,7 @@ declare class RecordsApi {
|
|
|
975
964
|
* @param merge Whether merge the supplied aspect data to existing aspect data or replace it
|
|
976
965
|
*/
|
|
977
966
|
putById(xMagdaTenantId: number, id: string, record: Record_2, xMagdaSession: string, merge?: boolean): Promise<{
|
|
978
|
-
response:
|
|
967
|
+
response: Response;
|
|
979
968
|
body: Record_2;
|
|
980
969
|
}>;
|
|
981
970
|
/**
|
|
@@ -988,7 +977,7 @@ declare class RecordsApi {
|
|
|
988
977
|
* @param merge Whether merge the supplied aspect data to existing aspect data or replace it
|
|
989
978
|
*/
|
|
990
979
|
putRecordsAspect(xMagdaTenantId: number, aspectId: string, requestData: PutRecordsAspectRequest, xMagdaSession: string, merge?: boolean): Promise<{
|
|
991
|
-
response:
|
|
980
|
+
response: Response;
|
|
992
981
|
body: Array<any>;
|
|
993
982
|
}>;
|
|
994
983
|
/**
|
|
@@ -1000,7 +989,7 @@ declare class RecordsApi {
|
|
|
1000
989
|
* @param xMagdaSession Magda internal session id
|
|
1001
990
|
*/
|
|
1002
991
|
trimBySourceTag(xMagdaTenantId: number, sourceTagToPreserve: string, sourceId: string, xMagdaSession: string): Promise<{
|
|
1003
|
-
response:
|
|
992
|
+
response: Response;
|
|
1004
993
|
body: MultipleDeleteResult;
|
|
1005
994
|
}>;
|
|
1006
995
|
}
|
|
@@ -1154,10 +1143,8 @@ declare class WebHookConfig {
|
|
|
1154
1143
|
declare class WebHooksApi {
|
|
1155
1144
|
protected basePath: string;
|
|
1156
1145
|
protected defaultHeaders: any;
|
|
1157
|
-
protected _useQuerystring: boolean;
|
|
1158
1146
|
protected authentications: any;
|
|
1159
1147
|
constructor(basePath?: string);
|
|
1160
|
-
set useQuerystring(value: boolean);
|
|
1161
1148
|
setApiKey(key: WebHooksApiApiKeys, value: string): void;
|
|
1162
1149
|
/**
|
|
1163
1150
|
* Acknowledge a previously-deferred web hook
|
|
@@ -1167,7 +1154,7 @@ declare class WebHooksApi {
|
|
|
1167
1154
|
* @param xMagdaSession Magda internal session id
|
|
1168
1155
|
*/
|
|
1169
1156
|
ack(id: string, acknowledgement: WebHookAcknowledgement, xMagdaSession: string): Promise<{
|
|
1170
|
-
response:
|
|
1157
|
+
response: Response;
|
|
1171
1158
|
body: WebHookAcknowledgementResponse;
|
|
1172
1159
|
}>;
|
|
1173
1160
|
/**
|
|
@@ -1177,7 +1164,7 @@ declare class WebHooksApi {
|
|
|
1177
1164
|
* @param xMagdaSession Magda internal session id
|
|
1178
1165
|
*/
|
|
1179
1166
|
create(hook: WebHook, xMagdaSession: string): Promise<{
|
|
1180
|
-
response:
|
|
1167
|
+
response: Response;
|
|
1181
1168
|
body: WebHook;
|
|
1182
1169
|
}>;
|
|
1183
1170
|
/**
|
|
@@ -1187,7 +1174,7 @@ declare class WebHooksApi {
|
|
|
1187
1174
|
* @param xMagdaSession Magda internal session id
|
|
1188
1175
|
*/
|
|
1189
1176
|
deleteById(hookId: string, xMagdaSession: string): Promise<{
|
|
1190
|
-
response:
|
|
1177
|
+
response: Response;
|
|
1191
1178
|
body: DeleteResult;
|
|
1192
1179
|
}>;
|
|
1193
1180
|
/**
|
|
@@ -1196,7 +1183,7 @@ declare class WebHooksApi {
|
|
|
1196
1183
|
* @param xMagdaSession Magda internal session id
|
|
1197
1184
|
*/
|
|
1198
1185
|
getAll(xMagdaSession: string): Promise<{
|
|
1199
|
-
response:
|
|
1186
|
+
response: Response;
|
|
1200
1187
|
body: Array<WebHook>;
|
|
1201
1188
|
}>;
|
|
1202
1189
|
/**
|
|
@@ -1206,7 +1193,7 @@ declare class WebHooksApi {
|
|
|
1206
1193
|
* @param xMagdaSession Magda internal session id
|
|
1207
1194
|
*/
|
|
1208
1195
|
getById(id: string, xMagdaSession: string): Promise<{
|
|
1209
|
-
response:
|
|
1196
|
+
response: Response;
|
|
1210
1197
|
body: WebHook;
|
|
1211
1198
|
}>;
|
|
1212
1199
|
/**
|
|
@@ -1217,7 +1204,7 @@ declare class WebHooksApi {
|
|
|
1217
1204
|
* @param xMagdaSession Magda internal session id
|
|
1218
1205
|
*/
|
|
1219
1206
|
putById(id: string, hook: WebHook, xMagdaSession: string): Promise<{
|
|
1220
|
-
response:
|
|
1207
|
+
response: Response;
|
|
1221
1208
|
body: WebHook;
|
|
1222
1209
|
}>;
|
|
1223
1210
|
}
|