@nxtedition/types 23.0.53 → 23.0.55

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.
@@ -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;
@@ -361,13 +361,13 @@ declare interface CommentReadMarkDomainRecords {
361
361
  }
362
362
 
363
363
  declare interface ConnectionBase {
364
- type: string | null;
364
+ type?: string | null;
365
365
  userNotificationsEnabled?: boolean;
366
366
  }
367
367
 
368
368
  declare interface ConnectionDef<Type extends string | null> {
369
369
  connection: ConnectionBase & {
370
- type: Type;
370
+ type?: Type;
371
371
  };
372
372
  methods: ConnectionMethodsBase;
373
373
  stats: ConnectionStatsBase;
@@ -492,7 +492,7 @@ declare interface EmptyConnectionDef extends ConnectionDef<null> {
492
492
  }
493
493
 
494
494
  declare interface EmptyConnectionRecord extends ConnectionBase {
495
- type: null;
495
+ type?: null;
496
496
  }
497
497
 
498
498
  /**
@@ -611,7 +611,7 @@ declare interface FacebookConnectionDef extends ConnectionDef<"facebook"> {
611
611
  }
612
612
 
613
613
  declare interface FacebookConnectionRecord extends ConnectionBase {
614
- type: "facebook";
614
+ type?: "facebook";
615
615
  grantedScopes?: string[];
616
616
  }
617
617
 
@@ -645,8 +645,8 @@ declare interface File_2 {
645
645
  }
646
646
 
647
647
  declare interface FileConnectionBase extends ConnectionBase {
648
- type: "file";
649
- protocol: string;
648
+ type?: "file";
649
+ protocol?: string;
650
650
  host?: string;
651
651
  port?: number | string;
652
652
  ignoreMissing?: boolean;
@@ -655,7 +655,7 @@ declare interface FileConnectionBase extends ConnectionBase {
655
655
  pollInterval?: number;
656
656
  listConcurrency?: number;
657
657
  metafile?: {
658
- content: string;
658
+ content?: string;
659
659
  };
660
660
  }
661
661
 
@@ -666,25 +666,84 @@ declare interface FileConnectionDef extends ConnectionDef<"file"> {
666
666
  }
667
667
 
668
668
  declare interface FileConnectionFtpRecord extends FileConnectionBase {
669
- protocol: "ftp";
670
- host: string;
669
+ protocol?: "ftp";
670
+ host?: string;
671
671
  username?: string;
672
672
  password?: string;
673
673
  utf8?: boolean;
674
674
  timezone?: string;
675
675
  }
676
676
 
677
- declare type FileConnectionRecord = FileConnectionS3Record | FileConnectionFtpRecord | FileConnectionSmbRecord | FileConnectionSftpRecord;
677
+ declare interface FileConnectionHeadResponse {
678
+ size?: number;
679
+ hash?: string;
680
+ }
681
+
682
+ declare interface FileConnectionHttpAction<RequestTemplateContext extends Record<string, unknown> = Record<string, unknown>, ResponseHandlerResult = undefined> {
683
+ request?: {
684
+ [Key in keyof HttpConnectionRequest]: Nxtpression<HttpConnectionRequest[Key], RequestTemplateContext & {
685
+ connection: FileConnectionHttpRecord;
686
+ }>;
687
+ };
688
+ response?: HttpConnectionResponseHandler<ResponseHandlerResult>;
689
+ }
690
+
691
+ declare interface FileConnectionHttpRecord extends FileConnectionBase {
692
+ protocol?: "http";
693
+ secure?: boolean;
694
+ authType?: "oauth2" | "none";
695
+ oauth2?: {
696
+ client?: {
697
+ id?: string;
698
+ secret?: string;
699
+ secretParamName?: string;
700
+ idParamName?: string;
701
+ };
702
+ auth?: {
703
+ tokenHost?: string;
704
+ tokenPath?: string;
705
+ refreshPath?: string;
706
+ revokePath?: string;
707
+ };
708
+ /**
709
+ * Default (static) parameters to be sent with the token request.
710
+ * Username and password should not be stored here, but rather provided
711
+ * by the hub through the `connect` rpc method.
712
+ */
713
+ tokenParams?: {
714
+ [key: string]: string;
715
+ };
716
+ grantType?: "password";
717
+ token?: {
718
+ accessToken: string;
719
+ refreshToken: string | null;
720
+ expiresAt: number | null;
721
+ idToken?: string;
722
+ };
723
+ error?: string;
724
+ };
725
+ actions?: HttpConnectionActions;
726
+ }
727
+
728
+ declare interface FileConnectionListResponseItem {
729
+ name: string;
730
+ isDir: boolean;
731
+ size: number;
732
+ date?: string;
733
+ path: string;
734
+ }
735
+
736
+ declare type FileConnectionRecord = FileConnectionFtpRecord | FileConnectionHttpRecord | FileConnectionS3Record | FileConnectionSmbRecord | FileConnectionSftpRecord;
678
737
 
679
738
  declare interface FileConnectionS3Record extends FileConnectionBase {
680
- protocol: "s3";
739
+ protocol?: "s3";
681
740
  client?: unknown;
682
741
  bucket?: string;
683
742
  }
684
743
 
685
744
  declare interface FileConnectionSftpRecord extends FileConnectionBase {
686
- protocol: "sftp";
687
- host: string;
745
+ protocol?: "sftp";
746
+ host?: string;
688
747
  username?: string;
689
748
  password?: string;
690
749
  privateKey?: string;
@@ -695,9 +754,9 @@ declare interface FileConnectionSftpRecord extends FileConnectionBase {
695
754
  }
696
755
 
697
756
  declare interface FileConnectionSmbRecord extends FileConnectionBase {
698
- protocol: "smb";
699
- host: string;
700
- share: string;
757
+ protocol?: "smb";
758
+ host?: string;
759
+ share?: string;
701
760
  workgroup?: string;
702
761
  username?: string;
703
762
  password?: string;
@@ -939,6 +998,71 @@ declare interface HorizontalRuleContent {
939
998
  type: "horizontalrule";
940
999
  }
941
1000
 
1001
+ declare interface HttpConnectionActions {
1002
+ ping?: FileConnectionHttpAction;
1003
+ head?: FileConnectionHttpAction<{
1004
+ filepath: string;
1005
+ }, FileConnectionHeadResponse | undefined>;
1006
+ list?: FileConnectionHttpAction<{
1007
+ dirpath?: string;
1008
+ }, FileConnectionListResponseItem[]>;
1009
+ get?: FileConnectionHttpAction<{
1010
+ id: string;
1011
+ offset?: number;
1012
+ }>;
1013
+ put?: FileConnectionHttpAction<{
1014
+ filepath: string;
1015
+ stream: unknown;
1016
+ }>;
1017
+ del?: FileConnectionHttpAction<{
1018
+ id: string;
1019
+ }>;
1020
+ }
1021
+
1022
+ declare interface HttpConnectionRequest {
1023
+ origin?: string;
1024
+ path?: string;
1025
+ method?: string;
1026
+ params?: {
1027
+ [key: string]: string | undefined;
1028
+ };
1029
+ form?: {
1030
+ [name: string]: {
1031
+ value: unknown;
1032
+ filename: string | undefined;
1033
+ };
1034
+ };
1035
+ headers?: {
1036
+ [key: string]: string | undefined;
1037
+ };
1038
+ throwOnError?: boolean;
1039
+ }
1040
+
1041
+ /**
1042
+ * Describes how to handle the response from an HTTP action
1043
+ */
1044
+ declare interface HttpConnectionResponseHandler<ResOutput = undefined> {
1045
+ responseFormat?: "text" | "json" | "stream";
1046
+ /** Resolve to an error message to indicate failure */
1047
+ error?: Nxtpression<string | null | undefined, {
1048
+ connection: FileConnectionHttpRecord;
1049
+ headers: Record<string, string | string[] | undefined>;
1050
+ statusCode: number;
1051
+ }>;
1052
+ /** Resolve to the desired output. Input will be parsed according to responseFormat. */
1053
+ transform?: Nxtpression<ResOutput, {
1054
+ connection: FileConnectionHttpRecord;
1055
+ /** Body parsed as JSON if responseFormat is 'json' */
1056
+ json?: unknown;
1057
+ /** Body as text if responseFormat is 'text' */
1058
+ text?: string;
1059
+ /** Response headers */
1060
+ headers: Record<string, string | string[] | undefined>;
1061
+ /** Response status code */
1062
+ statusCode: number;
1063
+ }>;
1064
+ }
1065
+
942
1066
  /**
943
1067
  An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
944
1068
 
@@ -2270,7 +2394,7 @@ declare interface ReutersConnectionDef extends ConnectionDef<"reuters"> {
2270
2394
  }
2271
2395
 
2272
2396
  declare interface ReutersConnectionRecord extends ConnectionBase {
2273
- type: "reuters";
2397
+ type?: "reuters";
2274
2398
  clientId?: string;
2275
2399
  clientSecret?: string;
2276
2400
  audience?: string;
@@ -2643,6 +2767,7 @@ declare interface Settings {
2643
2767
  label?: string | null;
2644
2768
  color?: string | null;
2645
2769
  }>;
2770
+ overridableProperties?: Array<keyof SubtitleStyle | null>;
2646
2771
  };
2647
2772
  subtitleTemplateId?: string;
2648
2773
  initialVolume?: string;
@@ -3369,7 +3494,7 @@ declare interface UserDomainReceivedNotificationsProvidedRecord {
3369
3494
  }
3370
3495
 
3371
3496
  declare interface UserDomainRecord {
3372
- username?: string;
3497
+ username?: string | null;
3373
3498
  roles?: string[];
3374
3499
  }
3375
3500
 
@@ -3,5 +3,5 @@ export interface EmptyConnectionDef extends ConnectionDef<null> {
3
3
  connection: EmptyConnectionRecord;
4
4
  }
5
5
  export interface EmptyConnectionRecord extends ConnectionBase {
6
- type: null;
6
+ type?: null;
7
7
  }
@@ -3,6 +3,6 @@ export interface FacebookConnectionDef extends ConnectionDef<"facebook"> {
3
3
  connection: FacebookConnectionRecord;
4
4
  }
5
5
  export interface FacebookConnectionRecord extends ConnectionBase {
6
- type: "facebook";
6
+ type?: "facebook";
7
7
  grantedScopes?: string[];
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import type { FileConnectionBase } from './index.ts';
2
2
  export interface FileConnectionFtpRecord extends FileConnectionBase {
3
- protocol: "ftp";
4
- host: string;
3
+ protocol?: "ftp";
4
+ host?: string;
5
5
  username?: string;
6
6
  password?: string;
7
7
  utf8?: boolean;
@@ -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 = FileConnectionS3Record | FileConnectionFtpRecord | FileConnectionSmbRecord | FileConnectionSftpRecord;
17
+ export type FileConnectionRecord = FileConnectionFtpRecord | FileConnectionHttpRecord | FileConnectionS3Record | FileConnectionSmbRecord | FileConnectionSftpRecord;
16
18
  export interface FileConnectionBase extends ConnectionBase {
17
- type: "file";
18
- protocol: string;
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: string;
29
+ content?: string;
28
30
  };
29
31
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./ftp.js";
2
+ export * from "./http.js";
2
3
  export * from "./s3.js";
3
4
  export * from "./smb.js";
4
5
  export * from "./sftp.js";
@@ -1,6 +1,6 @@
1
1
  import type { FileConnectionBase } from './index.ts';
2
2
  export interface FileConnectionS3Record extends FileConnectionBase {
3
- protocol: "s3";
3
+ protocol?: "s3";
4
4
  client?: unknown;
5
5
  bucket?: string;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import type { FileConnectionBase } from './index.ts';
2
2
  export interface FileConnectionSftpRecord extends FileConnectionBase {
3
- protocol: "sftp";
4
- host: string;
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: "smb";
4
- host: string;
5
- share: string;
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: Type;
20
+ type?: Type;
21
21
  };
22
22
  methods: ConnectionMethodsBase;
23
23
  stats: ConnectionStatsBase;
24
24
  }
25
25
  export interface ConnectionBase {
26
- type: string | null;
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: "reuters";
6
+ type?: "reuters";
7
7
  clientId?: string;
8
8
  clientSecret?: string;
9
9
  audience?: string;
@@ -5,7 +5,7 @@ export interface UserDomainRecords {
5
5
  ":user.unseenNotifications?": UserDomainUnseenNotificationsRecord;
6
6
  }
7
7
  export interface UserDomainRecord {
8
- username?: string;
8
+ username?: string | null;
9
9
  roles?: string[];
10
10
  }
11
11
  export interface UserDomainLatestSeenNotificationRecord {