@nxtedition/types 23.0.54 → 23.0.57
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/common/settings.d.ts +2 -0
- package/dist/nxtpression.d.ts +156 -25
- package/dist/records/domains/asset.d.ts +4 -0
- package/dist/records/domains/connection/empty.d.ts +1 -1
- package/dist/records/domains/connection/facebook.d.ts +1 -1
- package/dist/records/domains/connection/file/ftp.d.ts +2 -2
- package/dist/records/domains/connection/file/http.d.ts +130 -0
- package/dist/records/domains/connection/file/http.js +20 -0
- package/dist/records/domains/connection/file/index.d.ts +6 -4
- package/dist/records/domains/connection/file/index.js +1 -0
- package/dist/records/domains/connection/file/s3.d.ts +1 -1
- package/dist/records/domains/connection/file/sftp.d.ts +2 -2
- package/dist/records/domains/connection/file/smb.d.ts +3 -3
- package/dist/records/domains/connection/index.d.ts +2 -2
- package/dist/records/domains/connection/reuters.d.ts +1 -1
- package/dist/records/domains/publish/empty.d.ts +3 -3
- package/dist/records/domains/publish/facebook.d.ts +1 -1
- package/dist/records/domains/publish/file-legacy.d.ts +1 -1
- package/dist/records/domains/publish/file.d.ts +1 -1
- package/dist/records/domains/publish/index.d.ts +6 -2
- package/dist/records/domains/publish/youtube.d.ts +1 -1
- package/dist/records/validate/assert-guard.js +2572 -298
- package/dist/records/validate/assert.js +2573 -298
- package/dist/records/validate/is.js +169 -41
- package/dist/records/validate/schemas.js +2181 -124
- package/dist/records/validate/stringify.js +804 -60
- package/dist/records/validate/utils.js +1 -1
- package/dist/records/validate/validate-equals.js +3959 -537
- package/dist/records/validate/validate.js +2159 -283
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import type { Paths } from 'type-fest';
|
|
|
2
2
|
import type { PipelineSortMode } from './pipeline.ts';
|
|
3
3
|
import type { PromotedTag } from './promoted-tag.ts';
|
|
4
4
|
import type { NotificationReason } from './user-notification.ts';
|
|
5
|
+
import type { SubtitleStyle } from './subtitle-style.ts';
|
|
5
6
|
export interface Settings {
|
|
6
7
|
autoLogoutTime?: number;
|
|
7
8
|
permission?: {
|
|
@@ -175,6 +176,7 @@ export interface Settings {
|
|
|
175
176
|
label?: string | null;
|
|
176
177
|
color?: string | null;
|
|
177
178
|
}>;
|
|
179
|
+
overridableProperties?: Array<keyof SubtitleStyle | null>;
|
|
178
180
|
};
|
|
179
181
|
subtitleTemplateId?: string;
|
|
180
182
|
initialVolume?: string;
|
package/dist/nxtpression.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ declare interface AssetDomainPublishProvidedRecord {
|
|
|
117
117
|
|
|
118
118
|
declare interface AssetDomainRecords {
|
|
119
119
|
":asset.title?": AssetTitleProvidedRecord;
|
|
120
|
+
":asset.rawTypes?": AssetRawTypesProvidedRecord;
|
|
120
121
|
":asset.types?": AssetTypesProvidedRecord;
|
|
121
122
|
":asset.assignees?": AssetAssigneesProvidedRecord;
|
|
122
123
|
":asset.refs?": AssetRefsProvidedRecord;
|
|
@@ -203,6 +204,10 @@ declare interface AssetPermission {
|
|
|
203
204
|
tags?: undefined;
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
declare interface AssetRawTypesProvidedRecord {
|
|
208
|
+
value?: string[];
|
|
209
|
+
}
|
|
210
|
+
|
|
206
211
|
declare interface AssetRecords {
|
|
207
212
|
"asset.assignees": AssetAssigneesRecord;
|
|
208
213
|
"asset.clone": AssetCloneRecord;
|
|
@@ -361,13 +366,13 @@ declare interface CommentReadMarkDomainRecords {
|
|
|
361
366
|
}
|
|
362
367
|
|
|
363
368
|
declare interface ConnectionBase {
|
|
364
|
-
type
|
|
369
|
+
type?: string | null;
|
|
365
370
|
userNotificationsEnabled?: boolean;
|
|
366
371
|
}
|
|
367
372
|
|
|
368
373
|
declare interface ConnectionDef<Type extends string | null> {
|
|
369
374
|
connection: ConnectionBase & {
|
|
370
|
-
type
|
|
375
|
+
type?: Type;
|
|
371
376
|
};
|
|
372
377
|
methods: ConnectionMethodsBase;
|
|
373
378
|
stats: ConnectionStatsBase;
|
|
@@ -492,7 +497,7 @@ declare interface EmptyConnectionDef extends ConnectionDef<null> {
|
|
|
492
497
|
}
|
|
493
498
|
|
|
494
499
|
declare interface EmptyConnectionRecord extends ConnectionBase {
|
|
495
|
-
type
|
|
500
|
+
type?: null;
|
|
496
501
|
}
|
|
497
502
|
|
|
498
503
|
/**
|
|
@@ -529,8 +534,8 @@ declare interface EmptyPublishDef extends PublishDef<null> {
|
|
|
529
534
|
publish: EmptyPublishRecord;
|
|
530
535
|
}
|
|
531
536
|
|
|
532
|
-
declare interface EmptyPublishRecord {
|
|
533
|
-
type
|
|
537
|
+
declare interface EmptyPublishRecord extends PublishRecordBase {
|
|
538
|
+
type?: null;
|
|
534
539
|
asset?: string | null;
|
|
535
540
|
}
|
|
536
541
|
|
|
@@ -611,7 +616,7 @@ declare interface FacebookConnectionDef extends ConnectionDef<"facebook"> {
|
|
|
611
616
|
}
|
|
612
617
|
|
|
613
618
|
declare interface FacebookConnectionRecord extends ConnectionBase {
|
|
614
|
-
type
|
|
619
|
+
type?: "facebook";
|
|
615
620
|
grantedScopes?: string[];
|
|
616
621
|
}
|
|
617
622
|
|
|
@@ -621,7 +626,7 @@ declare interface FacebookPublishDef extends PublishDef<"facebook"> {
|
|
|
621
626
|
}
|
|
622
627
|
|
|
623
628
|
declare interface FacebookPublishRecord extends PublishRecordBase {
|
|
624
|
-
type
|
|
629
|
+
type?: "facebook";
|
|
625
630
|
pageId?: string;
|
|
626
631
|
}
|
|
627
632
|
|
|
@@ -645,8 +650,8 @@ declare interface File_2 {
|
|
|
645
650
|
}
|
|
646
651
|
|
|
647
652
|
declare interface FileConnectionBase extends ConnectionBase {
|
|
648
|
-
type
|
|
649
|
-
protocol
|
|
653
|
+
type?: "file";
|
|
654
|
+
protocol?: string;
|
|
650
655
|
host?: string;
|
|
651
656
|
port?: number | string;
|
|
652
657
|
ignoreMissing?: boolean;
|
|
@@ -655,7 +660,7 @@ declare interface FileConnectionBase extends ConnectionBase {
|
|
|
655
660
|
pollInterval?: number;
|
|
656
661
|
listConcurrency?: number;
|
|
657
662
|
metafile?: {
|
|
658
|
-
content
|
|
663
|
+
content?: string;
|
|
659
664
|
};
|
|
660
665
|
}
|
|
661
666
|
|
|
@@ -666,25 +671,84 @@ declare interface FileConnectionDef extends ConnectionDef<"file"> {
|
|
|
666
671
|
}
|
|
667
672
|
|
|
668
673
|
declare interface FileConnectionFtpRecord extends FileConnectionBase {
|
|
669
|
-
protocol
|
|
670
|
-
host
|
|
674
|
+
protocol?: "ftp";
|
|
675
|
+
host?: string;
|
|
671
676
|
username?: string;
|
|
672
677
|
password?: string;
|
|
673
678
|
utf8?: boolean;
|
|
674
679
|
timezone?: string;
|
|
675
680
|
}
|
|
676
681
|
|
|
677
|
-
declare
|
|
682
|
+
declare interface FileConnectionHeadResponse {
|
|
683
|
+
size?: number;
|
|
684
|
+
hash?: string;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
declare interface FileConnectionHttpAction<RequestTemplateContext extends Record<string, unknown> = Record<string, unknown>, ResponseHandlerResult = undefined> {
|
|
688
|
+
request?: {
|
|
689
|
+
[Key in keyof HttpConnectionRequest]: Nxtpression<HttpConnectionRequest[Key], RequestTemplateContext & {
|
|
690
|
+
connection: FileConnectionHttpRecord;
|
|
691
|
+
}>;
|
|
692
|
+
};
|
|
693
|
+
response?: HttpConnectionResponseHandler<ResponseHandlerResult>;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
declare interface FileConnectionHttpRecord extends FileConnectionBase {
|
|
697
|
+
protocol?: "http";
|
|
698
|
+
secure?: boolean;
|
|
699
|
+
authType?: "oauth2" | "none";
|
|
700
|
+
oauth2?: {
|
|
701
|
+
client?: {
|
|
702
|
+
id?: string;
|
|
703
|
+
secret?: string;
|
|
704
|
+
secretParamName?: string;
|
|
705
|
+
idParamName?: string;
|
|
706
|
+
};
|
|
707
|
+
auth?: {
|
|
708
|
+
tokenHost?: string;
|
|
709
|
+
tokenPath?: string;
|
|
710
|
+
refreshPath?: string;
|
|
711
|
+
revokePath?: string;
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* Default (static) parameters to be sent with the token request.
|
|
715
|
+
* Username and password should not be stored here, but rather provided
|
|
716
|
+
* by the hub through the `connect` rpc method.
|
|
717
|
+
*/
|
|
718
|
+
tokenParams?: {
|
|
719
|
+
[key: string]: string;
|
|
720
|
+
};
|
|
721
|
+
grantType?: "password";
|
|
722
|
+
token?: {
|
|
723
|
+
accessToken: string;
|
|
724
|
+
refreshToken: string | null;
|
|
725
|
+
expiresAt: number | null;
|
|
726
|
+
idToken?: string;
|
|
727
|
+
};
|
|
728
|
+
error?: string;
|
|
729
|
+
};
|
|
730
|
+
actions?: HttpConnectionActions;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare interface FileConnectionListResponseItem {
|
|
734
|
+
name: string;
|
|
735
|
+
isDir: boolean;
|
|
736
|
+
size: number;
|
|
737
|
+
date?: string;
|
|
738
|
+
path: string;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
declare type FileConnectionRecord = FileConnectionFtpRecord | FileConnectionHttpRecord | FileConnectionS3Record | FileConnectionSmbRecord | FileConnectionSftpRecord;
|
|
678
742
|
|
|
679
743
|
declare interface FileConnectionS3Record extends FileConnectionBase {
|
|
680
|
-
protocol
|
|
744
|
+
protocol?: "s3";
|
|
681
745
|
client?: unknown;
|
|
682
746
|
bucket?: string;
|
|
683
747
|
}
|
|
684
748
|
|
|
685
749
|
declare interface FileConnectionSftpRecord extends FileConnectionBase {
|
|
686
|
-
protocol
|
|
687
|
-
host
|
|
750
|
+
protocol?: "sftp";
|
|
751
|
+
host?: string;
|
|
688
752
|
username?: string;
|
|
689
753
|
password?: string;
|
|
690
754
|
privateKey?: string;
|
|
@@ -695,9 +759,9 @@ declare interface FileConnectionSftpRecord extends FileConnectionBase {
|
|
|
695
759
|
}
|
|
696
760
|
|
|
697
761
|
declare interface FileConnectionSmbRecord extends FileConnectionBase {
|
|
698
|
-
protocol
|
|
699
|
-
host
|
|
700
|
-
share
|
|
762
|
+
protocol?: "smb";
|
|
763
|
+
host?: string;
|
|
764
|
+
share?: string;
|
|
701
765
|
workgroup?: string;
|
|
702
766
|
username?: string;
|
|
703
767
|
password?: string;
|
|
@@ -737,7 +801,7 @@ declare interface FilePublishPublished {
|
|
|
737
801
|
}
|
|
738
802
|
|
|
739
803
|
declare interface FilePublishRecord extends PublishRecordBase {
|
|
740
|
-
type
|
|
804
|
+
type?: "file";
|
|
741
805
|
directory?: string;
|
|
742
806
|
filename?: string;
|
|
743
807
|
renders?: Record<string, FilePublishRender>;
|
|
@@ -747,7 +811,7 @@ declare interface FilePublishRecord extends PublishRecordBase {
|
|
|
747
811
|
}
|
|
748
812
|
|
|
749
813
|
declare interface FilePublishRecordLegacy extends PublishRecordBase {
|
|
750
|
-
type
|
|
814
|
+
type?: "file";
|
|
751
815
|
directory?: string;
|
|
752
816
|
filename?: string;
|
|
753
817
|
draft?: FilePublishDraft;
|
|
@@ -939,6 +1003,71 @@ declare interface HorizontalRuleContent {
|
|
|
939
1003
|
type: "horizontalrule";
|
|
940
1004
|
}
|
|
941
1005
|
|
|
1006
|
+
declare interface HttpConnectionActions {
|
|
1007
|
+
ping?: FileConnectionHttpAction;
|
|
1008
|
+
head?: FileConnectionHttpAction<{
|
|
1009
|
+
filepath: string;
|
|
1010
|
+
}, FileConnectionHeadResponse | undefined>;
|
|
1011
|
+
list?: FileConnectionHttpAction<{
|
|
1012
|
+
dirpath?: string;
|
|
1013
|
+
}, FileConnectionListResponseItem[]>;
|
|
1014
|
+
get?: FileConnectionHttpAction<{
|
|
1015
|
+
id: string;
|
|
1016
|
+
offset?: number;
|
|
1017
|
+
}>;
|
|
1018
|
+
put?: FileConnectionHttpAction<{
|
|
1019
|
+
filepath: string;
|
|
1020
|
+
stream: unknown;
|
|
1021
|
+
}>;
|
|
1022
|
+
del?: FileConnectionHttpAction<{
|
|
1023
|
+
id: string;
|
|
1024
|
+
}>;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare interface HttpConnectionRequest {
|
|
1028
|
+
origin?: string;
|
|
1029
|
+
path?: string;
|
|
1030
|
+
method?: string;
|
|
1031
|
+
params?: {
|
|
1032
|
+
[key: string]: string | undefined;
|
|
1033
|
+
};
|
|
1034
|
+
form?: {
|
|
1035
|
+
[name: string]: {
|
|
1036
|
+
value: unknown;
|
|
1037
|
+
filename: string | undefined;
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
1040
|
+
headers?: {
|
|
1041
|
+
[key: string]: string | undefined;
|
|
1042
|
+
};
|
|
1043
|
+
throwOnError?: boolean;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Describes how to handle the response from an HTTP action
|
|
1048
|
+
*/
|
|
1049
|
+
declare interface HttpConnectionResponseHandler<ResOutput = undefined> {
|
|
1050
|
+
responseFormat?: "text" | "json" | "stream";
|
|
1051
|
+
/** Resolve to an error message to indicate failure */
|
|
1052
|
+
error?: Nxtpression<string | null | undefined, {
|
|
1053
|
+
connection: FileConnectionHttpRecord;
|
|
1054
|
+
headers: Record<string, string | string[] | undefined>;
|
|
1055
|
+
statusCode: number;
|
|
1056
|
+
}>;
|
|
1057
|
+
/** Resolve to the desired output. Input will be parsed according to responseFormat. */
|
|
1058
|
+
transform?: Nxtpression<ResOutput, {
|
|
1059
|
+
connection: FileConnectionHttpRecord;
|
|
1060
|
+
/** Body parsed as JSON if responseFormat is 'json' */
|
|
1061
|
+
json?: unknown;
|
|
1062
|
+
/** Body as text if responseFormat is 'text' */
|
|
1063
|
+
text?: string;
|
|
1064
|
+
/** Response headers */
|
|
1065
|
+
headers: Record<string, string | string[] | undefined>;
|
|
1066
|
+
/** Response status code */
|
|
1067
|
+
statusCode: number;
|
|
1068
|
+
}>;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
942
1071
|
/**
|
|
943
1072
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
944
1073
|
|
|
@@ -1953,8 +2082,9 @@ declare interface ProvidedPermissionRecord {
|
|
|
1953
2082
|
declare type PublishAcceptsProvidedRecord = Union_2["accepts"];
|
|
1954
2083
|
|
|
1955
2084
|
declare interface PublishDef<Type extends string | null> {
|
|
2085
|
+
type: Type;
|
|
1956
2086
|
publish: PublishRecordBase & {
|
|
1957
|
-
type
|
|
2087
|
+
type?: Type;
|
|
1958
2088
|
};
|
|
1959
2089
|
stats: PublishStatsRecordBase;
|
|
1960
2090
|
methods: PublishDomainMethodsRecordBase;
|
|
@@ -1998,7 +2128,7 @@ declare type PublishMethodsRecord = Union_2["methods"];
|
|
|
1998
2128
|
declare type PublishRecord = Union_2["publish"];
|
|
1999
2129
|
|
|
2000
2130
|
declare interface PublishRecordBase {
|
|
2001
|
-
type
|
|
2131
|
+
type?: string | null;
|
|
2002
2132
|
asset?: string | null;
|
|
2003
2133
|
connection?: string;
|
|
2004
2134
|
render?: PublishRenderBase;
|
|
@@ -2270,7 +2400,7 @@ declare interface ReutersConnectionDef extends ConnectionDef<"reuters"> {
|
|
|
2270
2400
|
}
|
|
2271
2401
|
|
|
2272
2402
|
declare interface ReutersConnectionRecord extends ConnectionBase {
|
|
2273
|
-
type
|
|
2403
|
+
type?: "reuters";
|
|
2274
2404
|
clientId?: string;
|
|
2275
2405
|
clientSecret?: string;
|
|
2276
2406
|
audience?: string;
|
|
@@ -2643,6 +2773,7 @@ declare interface Settings {
|
|
|
2643
2773
|
label?: string | null;
|
|
2644
2774
|
color?: string | null;
|
|
2645
2775
|
}>;
|
|
2776
|
+
overridableProperties?: Array<keyof SubtitleStyle | null>;
|
|
2646
2777
|
};
|
|
2647
2778
|
subtitleTemplateId?: string;
|
|
2648
2779
|
initialVolume?: string;
|
|
@@ -3525,7 +3656,7 @@ declare interface YoutubePublishDef extends PublishDef<"youtube"> {
|
|
|
3525
3656
|
}
|
|
3526
3657
|
|
|
3527
3658
|
declare interface YoutubePublishRecord extends PublishRecordBase {
|
|
3528
|
-
type
|
|
3659
|
+
type?: "youtube";
|
|
3529
3660
|
draft?: {
|
|
3530
3661
|
snippet?: {
|
|
3531
3662
|
title?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IsoTimestamp } from '../../common/index.ts';
|
|
2
2
|
export interface AssetDomainRecords {
|
|
3
3
|
":asset.title?": AssetTitleProvidedRecord;
|
|
4
|
+
":asset.rawTypes?": AssetRawTypesProvidedRecord;
|
|
4
5
|
":asset.types?": AssetTypesProvidedRecord;
|
|
5
6
|
":asset.assignees?": AssetAssigneesProvidedRecord;
|
|
6
7
|
":asset.refs?": AssetRefsProvidedRecord;
|
|
@@ -24,6 +25,9 @@ export interface AssetDomainRecords {
|
|
|
24
25
|
export interface AssetTitleProvidedRecord {
|
|
25
26
|
value?: string;
|
|
26
27
|
}
|
|
28
|
+
export interface AssetRawTypesProvidedRecord {
|
|
29
|
+
value?: string[];
|
|
30
|
+
}
|
|
27
31
|
export interface AssetTypesProvidedRecord {
|
|
28
32
|
value?: string[];
|
|
29
33
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { FileConnectionBase } from './index.ts';
|
|
2
|
+
import type { Nxtpression } from '../../../../common/nxtpression.ts';
|
|
3
|
+
export interface FileConnectionHttpRecord extends FileConnectionBase {
|
|
4
|
+
protocol?: "http";
|
|
5
|
+
secure?: boolean;
|
|
6
|
+
authType?: "oauth2" | "none";
|
|
7
|
+
oauth2?: {
|
|
8
|
+
client?: {
|
|
9
|
+
id?: string;
|
|
10
|
+
secret?: string;
|
|
11
|
+
secretParamName?: string;
|
|
12
|
+
idParamName?: string;
|
|
13
|
+
};
|
|
14
|
+
auth?: {
|
|
15
|
+
tokenHost?: string;
|
|
16
|
+
tokenPath?: string;
|
|
17
|
+
refreshPath?: string;
|
|
18
|
+
revokePath?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Default (static) parameters to be sent with the token request.
|
|
22
|
+
* Username and password should not be stored here, but rather provided
|
|
23
|
+
* by the hub through the `connect` rpc method.
|
|
24
|
+
*/
|
|
25
|
+
tokenParams?: {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
};
|
|
28
|
+
grantType?: "password";
|
|
29
|
+
token?: {
|
|
30
|
+
accessToken: string;
|
|
31
|
+
refreshToken: string | null;
|
|
32
|
+
expiresAt: number | null;
|
|
33
|
+
idToken?: string;
|
|
34
|
+
};
|
|
35
|
+
error?: string;
|
|
36
|
+
};
|
|
37
|
+
actions?: HttpConnectionActions;
|
|
38
|
+
}
|
|
39
|
+
export interface HttpConnectionActions {
|
|
40
|
+
ping?: FileConnectionHttpAction;
|
|
41
|
+
head?: FileConnectionHttpAction<{
|
|
42
|
+
filepath: string;
|
|
43
|
+
}, FileConnectionHeadResponse | undefined>;
|
|
44
|
+
list?: FileConnectionHttpAction<{
|
|
45
|
+
dirpath?: string;
|
|
46
|
+
}, FileConnectionListResponseItem[]>;
|
|
47
|
+
get?: FileConnectionHttpAction<{
|
|
48
|
+
id: string;
|
|
49
|
+
offset?: number;
|
|
50
|
+
}>;
|
|
51
|
+
put?: FileConnectionHttpAction<{
|
|
52
|
+
filepath: string;
|
|
53
|
+
stream: unknown;
|
|
54
|
+
}>;
|
|
55
|
+
del?: FileConnectionHttpAction<{
|
|
56
|
+
id: string;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
59
|
+
export interface FileConnectionHttpAction<RequestTemplateContext extends Record<string, unknown> = Record<string, unknown>, ResponseHandlerResult = undefined> {
|
|
60
|
+
request?: {
|
|
61
|
+
[Key in keyof HttpConnectionRequest]: Nxtpression<HttpConnectionRequest[Key], RequestTemplateContext & {
|
|
62
|
+
connection: FileConnectionHttpRecord;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
response?: HttpConnectionResponseHandler<ResponseHandlerResult>;
|
|
66
|
+
}
|
|
67
|
+
export interface HttpConnectionRequest {
|
|
68
|
+
origin?: string;
|
|
69
|
+
path?: string;
|
|
70
|
+
method?: string;
|
|
71
|
+
params?: {
|
|
72
|
+
[key: string]: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
form?: {
|
|
75
|
+
[name: string]: {
|
|
76
|
+
value: unknown;
|
|
77
|
+
filename: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
headers?: {
|
|
81
|
+
[key: string]: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
throwOnError?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export declare const isHttpConnectionRequest: (input: unknown) => input is HttpConnectionRequest;
|
|
86
|
+
/**
|
|
87
|
+
* Describes how to handle the response from an HTTP action
|
|
88
|
+
*/
|
|
89
|
+
export interface HttpConnectionResponseHandler<ResOutput = undefined> {
|
|
90
|
+
responseFormat?: "text" | "json" | "stream";
|
|
91
|
+
/** Resolve to an error message to indicate failure */
|
|
92
|
+
error?: Nxtpression<string | null | undefined, {
|
|
93
|
+
connection: FileConnectionHttpRecord;
|
|
94
|
+
headers: Record<string, string | string[] | undefined>;
|
|
95
|
+
statusCode: number;
|
|
96
|
+
}>;
|
|
97
|
+
/** Resolve to the desired output. Input will be parsed according to responseFormat. */
|
|
98
|
+
transform?: Nxtpression<ResOutput, {
|
|
99
|
+
connection: FileConnectionHttpRecord;
|
|
100
|
+
/** Body parsed as JSON if responseFormat is 'json' */
|
|
101
|
+
json?: unknown;
|
|
102
|
+
/** Body as text if responseFormat is 'text' */
|
|
103
|
+
text?: string;
|
|
104
|
+
/** Response headers */
|
|
105
|
+
headers: Record<string, string | string[] | undefined>;
|
|
106
|
+
/** Response status code */
|
|
107
|
+
statusCode: number;
|
|
108
|
+
}>;
|
|
109
|
+
}
|
|
110
|
+
export interface FileConnectionHttpPasswordAuth {
|
|
111
|
+
username: string;
|
|
112
|
+
password: string;
|
|
113
|
+
scope?: string[];
|
|
114
|
+
resource?: string | string[];
|
|
115
|
+
}
|
|
116
|
+
export declare const isFileConnectionHttpPasswordAuth: (input: unknown) => input is FileConnectionHttpPasswordAuth;
|
|
117
|
+
interface FileConnectionHeadResponse {
|
|
118
|
+
size?: number;
|
|
119
|
+
hash?: string;
|
|
120
|
+
}
|
|
121
|
+
export declare const isFileConnectionHeadResponse: (input: unknown) => input is FileConnectionHeadResponse;
|
|
122
|
+
export interface FileConnectionListResponseItem {
|
|
123
|
+
name: string;
|
|
124
|
+
isDir: boolean;
|
|
125
|
+
size: number;
|
|
126
|
+
date?: string;
|
|
127
|
+
path: string;
|
|
128
|
+
}
|
|
129
|
+
export declare const isFileConnectionListResponseItem: (input: unknown) => input is FileConnectionListResponseItem;
|
|
130
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import typia from 'typia';
|
|
2
|
+
export const isHttpConnectionRequest = (() => { const _io0 = input => (undefined === input.origin || "string" === typeof input.origin) && (undefined === input.path || "string" === typeof input.path) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.params || "object" === typeof input.params && null !== input.params && false === Array.isArray(input.params) && _io1(input.params)) && (undefined === input.form || "object" === typeof input.form && null !== input.form && false === Array.isArray(input.form) && _io2(input.form)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && _io4(input.headers)) && (undefined === input.throwOnError || "boolean" === typeof input.throwOnError); const _io1 = input => Object.keys(input).every(key => {
|
|
3
|
+
const value = input[key];
|
|
4
|
+
if (undefined === value)
|
|
5
|
+
return true;
|
|
6
|
+
return undefined === value || "string" === typeof value;
|
|
7
|
+
}); const _io2 = input => Object.keys(input).every(key => {
|
|
8
|
+
const value = input[key];
|
|
9
|
+
if (undefined === value)
|
|
10
|
+
return true;
|
|
11
|
+
return "object" === typeof value && null !== value && _io3(value);
|
|
12
|
+
}); const _io3 = input => true && (undefined === input.filename || "string" === typeof input.filename); const _io4 = input => Object.keys(input).every(key => {
|
|
13
|
+
const value = input[key];
|
|
14
|
+
if (undefined === value)
|
|
15
|
+
return true;
|
|
16
|
+
return undefined === value || "string" === typeof value;
|
|
17
|
+
}); return input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); })();
|
|
18
|
+
export const isFileConnectionHttpPasswordAuth = (() => { const _io0 = input => "string" === typeof input.username && "string" === typeof input.password && (undefined === input.scope || Array.isArray(input.scope) && input.scope.every(elem => "string" === typeof elem)) && (null !== input.resource && (undefined === input.resource || "string" === typeof input.resource || Array.isArray(input.resource) && input.resource.every(elem => "string" === typeof elem))); return input => "object" === typeof input && null !== input && _io0(input); })();
|
|
19
|
+
export const isFileConnectionHeadResponse = (() => { const _io0 = input => (undefined === input.size || "number" === typeof input.size) && (undefined === input.hash || "string" === typeof input.hash); return input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); })();
|
|
20
|
+
export const isFileConnectionListResponseItem = (() => { const _io0 = input => "string" === typeof input.name && "boolean" === typeof input.isDir && "number" === typeof input.size && (undefined === input.date || "string" === typeof input.date) && "string" === typeof input.path; return input => "object" === typeof input && null !== input && _io0(input); })();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ConnectionDef, ConnectionMethodsBase, ConnectionBase, ConnectionStatsBase } from '../index.ts';
|
|
2
2
|
import type { FileConnectionFtpRecord } from './ftp.ts';
|
|
3
3
|
export * from './ftp.ts';
|
|
4
|
+
import type { FileConnectionHttpRecord } from './http.ts';
|
|
5
|
+
export * from './http.ts';
|
|
4
6
|
import type { FileConnectionS3Record } from './s3.ts';
|
|
5
7
|
export * from './s3.ts';
|
|
6
8
|
import type { FileConnectionSmbRecord } from './smb.ts';
|
|
@@ -12,10 +14,10 @@ export interface FileConnectionDef extends ConnectionDef<"file"> {
|
|
|
12
14
|
methods: ConnectionMethodsBase;
|
|
13
15
|
stats: ConnectionStatsBase;
|
|
14
16
|
}
|
|
15
|
-
export type FileConnectionRecord =
|
|
17
|
+
export type FileConnectionRecord = FileConnectionFtpRecord | FileConnectionHttpRecord | FileConnectionS3Record | FileConnectionSmbRecord | FileConnectionSftpRecord;
|
|
16
18
|
export interface FileConnectionBase extends ConnectionBase {
|
|
17
|
-
type
|
|
18
|
-
protocol
|
|
19
|
+
type?: "file";
|
|
20
|
+
protocol?: string;
|
|
19
21
|
host?: string;
|
|
20
22
|
port?: number | string;
|
|
21
23
|
ignoreMissing?: boolean;
|
|
@@ -24,6 +26,6 @@ export interface FileConnectionBase extends ConnectionBase {
|
|
|
24
26
|
pollInterval?: number;
|
|
25
27
|
listConcurrency?: number;
|
|
26
28
|
metafile?: {
|
|
27
|
-
content
|
|
29
|
+
content?: string;
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FileConnectionBase } from './index.ts';
|
|
2
2
|
export interface FileConnectionSftpRecord extends FileConnectionBase {
|
|
3
|
-
protocol
|
|
4
|
-
host
|
|
3
|
+
protocol?: "sftp";
|
|
4
|
+
host?: string;
|
|
5
5
|
username?: string;
|
|
6
6
|
password?: string;
|
|
7
7
|
privateKey?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FileConnectionBase } from './index.ts';
|
|
2
2
|
export interface FileConnectionSmbRecord extends FileConnectionBase {
|
|
3
|
-
protocol
|
|
4
|
-
host
|
|
5
|
-
share
|
|
3
|
+
protocol?: "smb";
|
|
4
|
+
host?: string;
|
|
5
|
+
share?: string;
|
|
6
6
|
workgroup?: string;
|
|
7
7
|
username?: string;
|
|
8
8
|
password?: string;
|
|
@@ -17,13 +17,13 @@ export interface ConnectionDomainRecords {
|
|
|
17
17
|
}
|
|
18
18
|
export interface ConnectionDef<Type extends string | null> {
|
|
19
19
|
connection: ConnectionBase & {
|
|
20
|
-
type
|
|
20
|
+
type?: Type;
|
|
21
21
|
};
|
|
22
22
|
methods: ConnectionMethodsBase;
|
|
23
23
|
stats: ConnectionStatsBase;
|
|
24
24
|
}
|
|
25
25
|
export interface ConnectionBase {
|
|
26
|
-
type
|
|
26
|
+
type?: string | null;
|
|
27
27
|
userNotificationsEnabled?: boolean;
|
|
28
28
|
}
|
|
29
29
|
export interface ConnectionMethodsBase {
|
|
@@ -3,7 +3,7 @@ export interface ReutersConnectionDef extends ConnectionDef<"reuters"> {
|
|
|
3
3
|
connection: ReutersConnectionRecord;
|
|
4
4
|
}
|
|
5
5
|
export interface ReutersConnectionRecord extends ConnectionBase {
|
|
6
|
-
type
|
|
6
|
+
type?: "reuters";
|
|
7
7
|
clientId?: string;
|
|
8
8
|
clientSecret?: string;
|
|
9
9
|
audience?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { PublishDef } from './index.ts';
|
|
1
|
+
import type { PublishDef, PublishRecordBase } from './index.ts';
|
|
2
2
|
export interface EmptyPublishDef extends PublishDef<null> {
|
|
3
3
|
publish: EmptyPublishRecord;
|
|
4
4
|
}
|
|
5
|
-
export interface EmptyPublishRecord {
|
|
6
|
-
type
|
|
5
|
+
export interface EmptyPublishRecord extends PublishRecordBase {
|
|
6
|
+
type?: null;
|
|
7
7
|
asset?: string | null;
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@ export interface FacebookPublishDef extends PublishDef<"facebook"> {
|
|
|
4
4
|
stats: FacebookPublishStatsRecord;
|
|
5
5
|
}
|
|
6
6
|
export interface FacebookPublishRecord extends PublishRecordBase {
|
|
7
|
-
type
|
|
7
|
+
type?: "facebook";
|
|
8
8
|
pageId?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface FacebookPublishStatsRecord extends PublishStatsRecordBase {
|
|
@@ -4,7 +4,7 @@ export interface FileLegacyPublishDef extends PublishDef<"file"> {
|
|
|
4
4
|
publish: FilePublishRecordLegacy;
|
|
5
5
|
}
|
|
6
6
|
export interface FilePublishRecordLegacy extends PublishRecordBase {
|
|
7
|
-
type
|
|
7
|
+
type?: "file";
|
|
8
8
|
directory?: string;
|
|
9
9
|
filename?: string;
|
|
10
10
|
draft?: FilePublishDraft;
|