@layer-drone/protocol 1.0.0 → 1.0.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.mts +811 -10
- package/dist/index.d.ts +811 -10
- package/dist/index.js +258 -0
- package/dist/index.mjs +244 -0
- package/package.json +3 -3
- package/src/client/sdk.gen.ts +369 -0
- package/src/client/transformers.gen.ts +35 -0
- package/src/client/types.gen.ts +559 -0
- package/src/event/types.gen.ts +29 -0
package/src/client/sdk.gen.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
flightsControllerGetFlight1ResponseTransformer,
|
|
27
27
|
flightsControllerValidateFlight0V1ResponseTransformer,
|
|
28
28
|
flightsControllerValidateFlight1ResponseTransformer,
|
|
29
|
+
getProposalResponseTransformer,
|
|
29
30
|
inboundWebhookConfigsControllerCreate0V1ResponseTransformer,
|
|
30
31
|
inboundWebhookConfigsControllerCreate1ResponseTransformer,
|
|
31
32
|
inboundWebhookConfigsControllerGet0V1ResponseTransformer,
|
|
@@ -34,6 +35,7 @@ import {
|
|
|
34
35
|
inboundWebhookConfigsControllerGetMany1ResponseTransformer,
|
|
35
36
|
inboundWebhookConfigsControllerUpdate0V1ResponseTransformer,
|
|
36
37
|
inboundWebhookConfigsControllerUpdate1ResponseTransformer,
|
|
38
|
+
listProposalsResponseTransformer,
|
|
37
39
|
missionsControllerCreateMissions0V1ResponseTransformer,
|
|
38
40
|
missionsControllerCreateMissions1ResponseTransformer,
|
|
39
41
|
missionsControllerGetMission0V1ResponseTransformer,
|
|
@@ -90,6 +92,36 @@ import type {
|
|
|
90
92
|
ApiTokenControllerUpdateToken1Data,
|
|
91
93
|
ApiTokenControllerUpdateToken1Errors,
|
|
92
94
|
ApiTokenControllerUpdateToken1Responses,
|
|
95
|
+
CampaignsControllerCreate0V1Data,
|
|
96
|
+
CampaignsControllerCreate0V1Errors,
|
|
97
|
+
CampaignsControllerCreate0V1Responses,
|
|
98
|
+
CampaignsControllerCreate1Data,
|
|
99
|
+
CampaignsControllerCreate1Errors,
|
|
100
|
+
CampaignsControllerCreate1Responses,
|
|
101
|
+
CampaignsControllerDelete0V1Data,
|
|
102
|
+
CampaignsControllerDelete0V1Errors,
|
|
103
|
+
CampaignsControllerDelete0V1Responses,
|
|
104
|
+
CampaignsControllerDelete1Data,
|
|
105
|
+
CampaignsControllerDelete1Errors,
|
|
106
|
+
CampaignsControllerDelete1Responses,
|
|
107
|
+
CampaignsControllerGet0V1Data,
|
|
108
|
+
CampaignsControllerGet0V1Errors,
|
|
109
|
+
CampaignsControllerGet0V1Responses,
|
|
110
|
+
CampaignsControllerGet1Data,
|
|
111
|
+
CampaignsControllerGet1Errors,
|
|
112
|
+
CampaignsControllerGet1Responses,
|
|
113
|
+
CampaignsControllerGetMany0V1Data,
|
|
114
|
+
CampaignsControllerGetMany0V1Errors,
|
|
115
|
+
CampaignsControllerGetMany0V1Responses,
|
|
116
|
+
CampaignsControllerGetMany1Data,
|
|
117
|
+
CampaignsControllerGetMany1Errors,
|
|
118
|
+
CampaignsControllerGetMany1Responses,
|
|
119
|
+
CampaignsControllerUpdate0V1Data,
|
|
120
|
+
CampaignsControllerUpdate0V1Errors,
|
|
121
|
+
CampaignsControllerUpdate0V1Responses,
|
|
122
|
+
CampaignsControllerUpdate1Data,
|
|
123
|
+
CampaignsControllerUpdate1Errors,
|
|
124
|
+
CampaignsControllerUpdate1Responses,
|
|
93
125
|
ConditionsControllerGetSunAltitudeTimeLimits0V1Data,
|
|
94
126
|
ConditionsControllerGetSunAltitudeTimeLimits0V1Responses,
|
|
95
127
|
ConditionsControllerGetSunAltitudeTimeLimits1Data,
|
|
@@ -196,6 +228,9 @@ import type {
|
|
|
196
228
|
FlightsControllerValidateFlight1Data,
|
|
197
229
|
FlightsControllerValidateFlight1Errors,
|
|
198
230
|
FlightsControllerValidateFlight1Responses,
|
|
231
|
+
GetProposalData,
|
|
232
|
+
GetProposalErrors,
|
|
233
|
+
GetProposalResponses,
|
|
199
234
|
InboundWebhookConfigsControllerCreate0V1Data,
|
|
200
235
|
InboundWebhookConfigsControllerCreate0V1Errors,
|
|
201
236
|
InboundWebhookConfigsControllerCreate0V1Responses,
|
|
@@ -230,6 +265,9 @@ import type {
|
|
|
230
265
|
KeysControllerGetProvenanceCryptoKey0V1Responses,
|
|
231
266
|
KeysControllerGetProvenanceCryptoKey1Data,
|
|
232
267
|
KeysControllerGetProvenanceCryptoKey1Responses,
|
|
268
|
+
ListProposalsData,
|
|
269
|
+
ListProposalsErrors,
|
|
270
|
+
ListProposalsResponses,
|
|
233
271
|
MissionsControllerCreateMissions0V1Data,
|
|
234
272
|
MissionsControllerCreateMissions0V1Errors,
|
|
235
273
|
MissionsControllerCreateMissions0V1Responses,
|
|
@@ -284,10 +322,16 @@ import type {
|
|
|
284
322
|
QuotesControllerGetQuote1Data,
|
|
285
323
|
QuotesControllerGetQuote1Errors,
|
|
286
324
|
QuotesControllerGetQuote1Responses,
|
|
325
|
+
ReviewProposalData,
|
|
326
|
+
ReviewProposalErrors,
|
|
327
|
+
ReviewProposalResponses,
|
|
287
328
|
SchemaControllerGetEventSchema0V1Data,
|
|
288
329
|
SchemaControllerGetEventSchema0V1Responses,
|
|
289
330
|
SchemaControllerGetEventSchema1Data,
|
|
290
331
|
SchemaControllerGetEventSchema1Responses,
|
|
332
|
+
SubmitProposalData,
|
|
333
|
+
SubmitProposalErrors,
|
|
334
|
+
SubmitProposalResponses,
|
|
291
335
|
VaultsControllerCreateVaults0V1Data,
|
|
292
336
|
VaultsControllerCreateVaults0V1Errors,
|
|
293
337
|
VaultsControllerCreateVaults0V1Responses,
|
|
@@ -635,6 +679,243 @@ export const apiTokenControllerUpdateToken1 = <
|
|
|
635
679
|
});
|
|
636
680
|
};
|
|
637
681
|
|
|
682
|
+
export const campaignsControllerGetMany0V1 = <
|
|
683
|
+
ThrowOnError extends boolean = false,
|
|
684
|
+
>(
|
|
685
|
+
options?: Options<CampaignsControllerGetMany0V1Data, ThrowOnError>,
|
|
686
|
+
) => {
|
|
687
|
+
return (options?.client ?? _heyApiClient).get<
|
|
688
|
+
CampaignsControllerGetMany0V1Responses,
|
|
689
|
+
CampaignsControllerGetMany0V1Errors,
|
|
690
|
+
ThrowOnError
|
|
691
|
+
>({
|
|
692
|
+
security: [
|
|
693
|
+
{
|
|
694
|
+
name: "x-api-token",
|
|
695
|
+
type: "apiKey",
|
|
696
|
+
},
|
|
697
|
+
],
|
|
698
|
+
url: "/v1/campaigns",
|
|
699
|
+
...options,
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
export const campaignsControllerCreate0V1 = <
|
|
704
|
+
ThrowOnError extends boolean = false,
|
|
705
|
+
>(
|
|
706
|
+
options: Options<CampaignsControllerCreate0V1Data, ThrowOnError>,
|
|
707
|
+
) => {
|
|
708
|
+
return (options.client ?? _heyApiClient).post<
|
|
709
|
+
CampaignsControllerCreate0V1Responses,
|
|
710
|
+
CampaignsControllerCreate0V1Errors,
|
|
711
|
+
ThrowOnError
|
|
712
|
+
>({
|
|
713
|
+
security: [
|
|
714
|
+
{
|
|
715
|
+
name: "x-api-token",
|
|
716
|
+
type: "apiKey",
|
|
717
|
+
},
|
|
718
|
+
],
|
|
719
|
+
url: "/v1/campaigns",
|
|
720
|
+
...options,
|
|
721
|
+
headers: {
|
|
722
|
+
"Content-Type": "application/json",
|
|
723
|
+
...options.headers,
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* @deprecated
|
|
730
|
+
*/
|
|
731
|
+
export const campaignsControllerGetMany1 = <
|
|
732
|
+
ThrowOnError extends boolean = false,
|
|
733
|
+
>(
|
|
734
|
+
options?: Options<CampaignsControllerGetMany1Data, ThrowOnError>,
|
|
735
|
+
) => {
|
|
736
|
+
return (options?.client ?? _heyApiClient).get<
|
|
737
|
+
CampaignsControllerGetMany1Responses,
|
|
738
|
+
CampaignsControllerGetMany1Errors,
|
|
739
|
+
ThrowOnError
|
|
740
|
+
>({
|
|
741
|
+
security: [
|
|
742
|
+
{
|
|
743
|
+
name: "x-api-token",
|
|
744
|
+
type: "apiKey",
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
url: "/campaigns",
|
|
748
|
+
...options,
|
|
749
|
+
});
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* @deprecated
|
|
754
|
+
*/
|
|
755
|
+
export const campaignsControllerCreate1 = <
|
|
756
|
+
ThrowOnError extends boolean = false,
|
|
757
|
+
>(
|
|
758
|
+
options: Options<CampaignsControllerCreate1Data, ThrowOnError>,
|
|
759
|
+
) => {
|
|
760
|
+
return (options.client ?? _heyApiClient).post<
|
|
761
|
+
CampaignsControllerCreate1Responses,
|
|
762
|
+
CampaignsControllerCreate1Errors,
|
|
763
|
+
ThrowOnError
|
|
764
|
+
>({
|
|
765
|
+
security: [
|
|
766
|
+
{
|
|
767
|
+
name: "x-api-token",
|
|
768
|
+
type: "apiKey",
|
|
769
|
+
},
|
|
770
|
+
],
|
|
771
|
+
url: "/campaigns",
|
|
772
|
+
...options,
|
|
773
|
+
headers: {
|
|
774
|
+
"Content-Type": "application/json",
|
|
775
|
+
...options.headers,
|
|
776
|
+
},
|
|
777
|
+
});
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
export const campaignsControllerDelete0V1 = <
|
|
781
|
+
ThrowOnError extends boolean = false,
|
|
782
|
+
>(
|
|
783
|
+
options: Options<CampaignsControllerDelete0V1Data, ThrowOnError>,
|
|
784
|
+
) => {
|
|
785
|
+
return (options.client ?? _heyApiClient).delete<
|
|
786
|
+
CampaignsControllerDelete0V1Responses,
|
|
787
|
+
CampaignsControllerDelete0V1Errors,
|
|
788
|
+
ThrowOnError
|
|
789
|
+
>({
|
|
790
|
+
security: [
|
|
791
|
+
{
|
|
792
|
+
name: "x-api-token",
|
|
793
|
+
type: "apiKey",
|
|
794
|
+
},
|
|
795
|
+
],
|
|
796
|
+
url: "/v1/campaigns/{id}",
|
|
797
|
+
...options,
|
|
798
|
+
});
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
export const campaignsControllerGet0V1 = <ThrowOnError extends boolean = false>(
|
|
802
|
+
options: Options<CampaignsControllerGet0V1Data, ThrowOnError>,
|
|
803
|
+
) => {
|
|
804
|
+
return (options.client ?? _heyApiClient).get<
|
|
805
|
+
CampaignsControllerGet0V1Responses,
|
|
806
|
+
CampaignsControllerGet0V1Errors,
|
|
807
|
+
ThrowOnError
|
|
808
|
+
>({
|
|
809
|
+
security: [
|
|
810
|
+
{
|
|
811
|
+
name: "x-api-token",
|
|
812
|
+
type: "apiKey",
|
|
813
|
+
},
|
|
814
|
+
],
|
|
815
|
+
url: "/v1/campaigns/{id}",
|
|
816
|
+
...options,
|
|
817
|
+
});
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
export const campaignsControllerUpdate0V1 = <
|
|
821
|
+
ThrowOnError extends boolean = false,
|
|
822
|
+
>(
|
|
823
|
+
options: Options<CampaignsControllerUpdate0V1Data, ThrowOnError>,
|
|
824
|
+
) => {
|
|
825
|
+
return (options.client ?? _heyApiClient).put<
|
|
826
|
+
CampaignsControllerUpdate0V1Responses,
|
|
827
|
+
CampaignsControllerUpdate0V1Errors,
|
|
828
|
+
ThrowOnError
|
|
829
|
+
>({
|
|
830
|
+
security: [
|
|
831
|
+
{
|
|
832
|
+
name: "x-api-token",
|
|
833
|
+
type: "apiKey",
|
|
834
|
+
},
|
|
835
|
+
],
|
|
836
|
+
url: "/v1/campaigns/{id}",
|
|
837
|
+
...options,
|
|
838
|
+
headers: {
|
|
839
|
+
"Content-Type": "application/json",
|
|
840
|
+
...options.headers,
|
|
841
|
+
},
|
|
842
|
+
});
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @deprecated
|
|
847
|
+
*/
|
|
848
|
+
export const campaignsControllerDelete1 = <
|
|
849
|
+
ThrowOnError extends boolean = false,
|
|
850
|
+
>(
|
|
851
|
+
options: Options<CampaignsControllerDelete1Data, ThrowOnError>,
|
|
852
|
+
) => {
|
|
853
|
+
return (options.client ?? _heyApiClient).delete<
|
|
854
|
+
CampaignsControllerDelete1Responses,
|
|
855
|
+
CampaignsControllerDelete1Errors,
|
|
856
|
+
ThrowOnError
|
|
857
|
+
>({
|
|
858
|
+
security: [
|
|
859
|
+
{
|
|
860
|
+
name: "x-api-token",
|
|
861
|
+
type: "apiKey",
|
|
862
|
+
},
|
|
863
|
+
],
|
|
864
|
+
url: "/campaigns/{id}",
|
|
865
|
+
...options,
|
|
866
|
+
});
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* @deprecated
|
|
871
|
+
*/
|
|
872
|
+
export const campaignsControllerGet1 = <ThrowOnError extends boolean = false>(
|
|
873
|
+
options: Options<CampaignsControllerGet1Data, ThrowOnError>,
|
|
874
|
+
) => {
|
|
875
|
+
return (options.client ?? _heyApiClient).get<
|
|
876
|
+
CampaignsControllerGet1Responses,
|
|
877
|
+
CampaignsControllerGet1Errors,
|
|
878
|
+
ThrowOnError
|
|
879
|
+
>({
|
|
880
|
+
security: [
|
|
881
|
+
{
|
|
882
|
+
name: "x-api-token",
|
|
883
|
+
type: "apiKey",
|
|
884
|
+
},
|
|
885
|
+
],
|
|
886
|
+
url: "/campaigns/{id}",
|
|
887
|
+
...options,
|
|
888
|
+
});
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* @deprecated
|
|
893
|
+
*/
|
|
894
|
+
export const campaignsControllerUpdate1 = <
|
|
895
|
+
ThrowOnError extends boolean = false,
|
|
896
|
+
>(
|
|
897
|
+
options: Options<CampaignsControllerUpdate1Data, ThrowOnError>,
|
|
898
|
+
) => {
|
|
899
|
+
return (options.client ?? _heyApiClient).put<
|
|
900
|
+
CampaignsControllerUpdate1Responses,
|
|
901
|
+
CampaignsControllerUpdate1Errors,
|
|
902
|
+
ThrowOnError
|
|
903
|
+
>({
|
|
904
|
+
security: [
|
|
905
|
+
{
|
|
906
|
+
name: "x-api-token",
|
|
907
|
+
type: "apiKey",
|
|
908
|
+
},
|
|
909
|
+
],
|
|
910
|
+
url: "/campaigns/{id}",
|
|
911
|
+
...options,
|
|
912
|
+
headers: {
|
|
913
|
+
"Content-Type": "application/json",
|
|
914
|
+
...options.headers,
|
|
915
|
+
},
|
|
916
|
+
});
|
|
917
|
+
};
|
|
918
|
+
|
|
638
919
|
export const conditionsControllerGetSunAltitudeTimeLimits0V1 = <
|
|
639
920
|
ThrowOnError extends boolean = false,
|
|
640
921
|
>(
|
|
@@ -1801,6 +2082,94 @@ export const missionsControllerRepriceMissions1 = <
|
|
|
1801
2082
|
});
|
|
1802
2083
|
};
|
|
1803
2084
|
|
|
2085
|
+
/**
|
|
2086
|
+
* List proposals (proxied to proposal-service)
|
|
2087
|
+
* Returns up to 50 proposals per page, sorted by created_at descending. All filters are optional. Use `page` (0-indexed, default 0) to paginate.
|
|
2088
|
+
*/
|
|
2089
|
+
export const listProposals = <ThrowOnError extends boolean = false>(
|
|
2090
|
+
options?: Options<ListProposalsData, ThrowOnError>,
|
|
2091
|
+
) => {
|
|
2092
|
+
return (options?.client ?? _heyApiClient).get<
|
|
2093
|
+
ListProposalsResponses,
|
|
2094
|
+
ListProposalsErrors,
|
|
2095
|
+
ThrowOnError
|
|
2096
|
+
>({
|
|
2097
|
+
responseTransformer: listProposalsResponseTransformer,
|
|
2098
|
+
url: "/v1/proposals",
|
|
2099
|
+
...options,
|
|
2100
|
+
});
|
|
2101
|
+
};
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Submit a proposal (proxied to proposal-service)
|
|
2105
|
+
*/
|
|
2106
|
+
export const submitProposal = <ThrowOnError extends boolean = false>(
|
|
2107
|
+
options: Options<SubmitProposalData, ThrowOnError>,
|
|
2108
|
+
) => {
|
|
2109
|
+
return (options.client ?? _heyApiClient).post<
|
|
2110
|
+
SubmitProposalResponses,
|
|
2111
|
+
SubmitProposalErrors,
|
|
2112
|
+
ThrowOnError
|
|
2113
|
+
>({
|
|
2114
|
+
security: [
|
|
2115
|
+
{
|
|
2116
|
+
name: "x-api-token",
|
|
2117
|
+
type: "apiKey",
|
|
2118
|
+
},
|
|
2119
|
+
],
|
|
2120
|
+
url: "/v1/proposals",
|
|
2121
|
+
...options,
|
|
2122
|
+
headers: {
|
|
2123
|
+
"Content-Type": "application/json",
|
|
2124
|
+
...options.headers,
|
|
2125
|
+
},
|
|
2126
|
+
});
|
|
2127
|
+
};
|
|
2128
|
+
|
|
2129
|
+
/**
|
|
2130
|
+
* Get a proposal by ID (proxied to proposal-service)
|
|
2131
|
+
* Returns full proposal detail including all change records.
|
|
2132
|
+
*/
|
|
2133
|
+
export const getProposal = <ThrowOnError extends boolean = false>(
|
|
2134
|
+
options: Options<GetProposalData, ThrowOnError>,
|
|
2135
|
+
) => {
|
|
2136
|
+
return (options.client ?? _heyApiClient).get<
|
|
2137
|
+
GetProposalResponses,
|
|
2138
|
+
GetProposalErrors,
|
|
2139
|
+
ThrowOnError
|
|
2140
|
+
>({
|
|
2141
|
+
responseTransformer: getProposalResponseTransformer,
|
|
2142
|
+
url: "/v1/proposals/{id}",
|
|
2143
|
+
...options,
|
|
2144
|
+
});
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2147
|
+
/**
|
|
2148
|
+
* Approve or reject a proposal (proxied to proposal-service)
|
|
2149
|
+
*/
|
|
2150
|
+
export const reviewProposal = <ThrowOnError extends boolean = false>(
|
|
2151
|
+
options: Options<ReviewProposalData, ThrowOnError>,
|
|
2152
|
+
) => {
|
|
2153
|
+
return (options.client ?? _heyApiClient).post<
|
|
2154
|
+
ReviewProposalResponses,
|
|
2155
|
+
ReviewProposalErrors,
|
|
2156
|
+
ThrowOnError
|
|
2157
|
+
>({
|
|
2158
|
+
security: [
|
|
2159
|
+
{
|
|
2160
|
+
name: "x-api-token",
|
|
2161
|
+
type: "apiKey",
|
|
2162
|
+
},
|
|
2163
|
+
],
|
|
2164
|
+
url: "/v1/proposals/{id}/review",
|
|
2165
|
+
...options,
|
|
2166
|
+
headers: {
|
|
2167
|
+
"Content-Type": "application/json",
|
|
2168
|
+
...options.headers,
|
|
2169
|
+
},
|
|
2170
|
+
});
|
|
2171
|
+
};
|
|
2172
|
+
|
|
1804
2173
|
export const protocolTriggersApiControllerTriggerPayout0V1 = <
|
|
1805
2174
|
ThrowOnError extends boolean = false,
|
|
1806
2175
|
>(
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
FlightsControllerGetFlight1Response,
|
|
21
21
|
FlightsControllerValidateFlight0V1Response,
|
|
22
22
|
FlightsControllerValidateFlight1Response,
|
|
23
|
+
GetProposalResponse,
|
|
23
24
|
InboundWebhookConfigsControllerCreate0V1Response,
|
|
24
25
|
InboundWebhookConfigsControllerCreate1Response,
|
|
25
26
|
InboundWebhookConfigsControllerGet0V1Response,
|
|
@@ -28,6 +29,7 @@ import type {
|
|
|
28
29
|
InboundWebhookConfigsControllerGetMany1Response,
|
|
29
30
|
InboundWebhookConfigsControllerUpdate0V1Response,
|
|
30
31
|
InboundWebhookConfigsControllerUpdate1Response,
|
|
32
|
+
ListProposalsResponse,
|
|
31
33
|
MissionsControllerCreateMissions0V1Response,
|
|
32
34
|
MissionsControllerCreateMissions1Response,
|
|
33
35
|
MissionsControllerGetMission0V1Response,
|
|
@@ -354,6 +356,39 @@ export const missionsControllerCreateMissions1ResponseTransformer = async (
|
|
|
354
356
|
return data;
|
|
355
357
|
};
|
|
356
358
|
|
|
359
|
+
const getProposalsResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
360
|
+
data.proposals = data.proposals.map((item: any) => {
|
|
361
|
+
item.created_at = new Date(item.created_at);
|
|
362
|
+
return item;
|
|
363
|
+
});
|
|
364
|
+
return data;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export const listProposalsResponseTransformer = async (
|
|
368
|
+
data: any,
|
|
369
|
+
): Promise<ListProposalsResponse> => {
|
|
370
|
+
data = getProposalsResponseDtoSchemaResponseTransformer(data);
|
|
371
|
+
return data;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const getProposalResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
375
|
+
data.created_at = new Date(data.created_at);
|
|
376
|
+
data.changes = data.changes.map((item: any) => {
|
|
377
|
+
item.dispatched_at = new Date(item.dispatched_at);
|
|
378
|
+
item.verified_at = new Date(item.verified_at);
|
|
379
|
+
item.failed_at = new Date(item.failed_at);
|
|
380
|
+
return item;
|
|
381
|
+
});
|
|
382
|
+
return data;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
export const getProposalResponseTransformer = async (
|
|
386
|
+
data: any,
|
|
387
|
+
): Promise<GetProposalResponse> => {
|
|
388
|
+
data = getProposalResponseDtoSchemaResponseTransformer(data);
|
|
389
|
+
return data;
|
|
390
|
+
};
|
|
391
|
+
|
|
357
392
|
const getWebhooksResponseSchemaResponseTransformer = (data: any) => {
|
|
358
393
|
data = data.map((item: any) => {
|
|
359
394
|
item.previous_secret_expires_at = new Date(item.previous_secret_expires_at);
|