@nxtedition/types 23.1.6 → 23.1.8

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 (33) hide show
  1. package/dist/common/index.d.ts +2 -0
  2. package/dist/common/index.js +2 -0
  3. package/dist/common/panel-property.d.ts +35 -2
  4. package/dist/common/render-scene.d.ts +2 -0
  5. package/dist/common/report.d.ts +85 -0
  6. package/dist/common/report.js +8 -0
  7. package/dist/common/rss.d.ts +70 -0
  8. package/dist/common/rss.js +11 -0
  9. package/dist/common/schema-property.d.ts +31 -27
  10. package/dist/common/settings.d.ts +3 -1
  11. package/dist/nxtpression.d.ts +306 -42
  12. package/dist/records/domains/connection/index.d.ts +3 -1
  13. package/dist/records/domains/connection/index.js +1 -0
  14. package/dist/records/domains/connection/report.d.ts +7 -0
  15. package/dist/records/domains/connection/report.js +1 -0
  16. package/dist/records/domains/file.d.ts +7 -0
  17. package/dist/records/domains/panel.d.ts +26 -3
  18. package/dist/records/domains/publish/index.d.ts +3 -1
  19. package/dist/records/domains/publish/index.js +1 -0
  20. package/dist/records/domains/publish/report.d.ts +70 -0
  21. package/dist/records/domains/publish/report.js +1304 -0
  22. package/dist/records/domains/render.d.ts +3 -0
  23. package/dist/records/domains/schema.d.ts +2 -2
  24. package/dist/records/validate/assert-guard.js +2659 -1038
  25. package/dist/records/validate/assert.js +2659 -1037
  26. package/dist/records/validate/is.js +143 -38
  27. package/dist/records/validate/schemas.js +1878 -657
  28. package/dist/records/validate/stringify.js +565 -101
  29. package/dist/records/validate/utils.js +1 -1
  30. package/dist/records/validate/validate-equals.js +2886 -861
  31. package/dist/records/validate/validate.js +2129 -777
  32. package/dist/rpc.d.ts +1 -1
  33. package/package.json +1 -1
@@ -414,38 +414,6 @@ declare interface AuthDomainRecords {
414
414
  ":auth": AuthDomainRecord;
415
415
  }
416
416
 
417
- declare interface BaseSchemaProperty<Value = unknown> {
418
- domain?: string;
419
- path?: string;
420
- /** Specifying what type of data will be entered into the field. */
421
- type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc" | undefined;
422
- /** User-friendly title of the property. This will be used as the field's label in the UI. */
423
- title?: string;
424
- description?: string;
425
- /** If present, indicates that the user must specify a value for the asset to be treated as valid. */
426
- required?: boolean;
427
- oneOf?: Array<BaseSchemaProperty>;
428
- anyOf?: Array<BaseSchemaProperty>;
429
- enum?: ReadonlyArray<Value>;
430
- widget?: WidgetType | WidgetOptions;
431
- placeholder?: string;
432
- helpText?: string;
433
- invalid?: boolean;
434
- emptyValue?: Value;
435
- minItems?: number;
436
- maxItems?: number;
437
- items?: BaseSchemaProperty<Value>;
438
- properties?: Record<string, BaseSchemaProperty<unknown>>;
439
- computed?: Nxtpression<Value>;
440
- /** An object specifying where to index the data. Adding this will effectively make the data searchable. */
441
- index?: {
442
- /** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
443
- label: string;
444
- /** A string specifying where to store the data in the search index. Note that this should be a globally unique value in the system. Typically you'd use `{domain}.{path}` and you should prefer English in camel case */
445
- path: string;
446
- };
447
- }
448
-
449
417
  declare interface BundleDomainRecords {
450
418
  [":bundle"]: BundleRecord;
451
419
  [":bundle.revisions"]: BundleRevisionsRecord;
@@ -621,6 +589,17 @@ declare interface ContactRecord {
621
589
  address?: string;
622
590
  }
623
591
 
592
+ /**
593
+ * @link https://oozcitak.github.io/xmlbuilder2/builder-functions.html#settings-related-to-value-conversions
594
+ */
595
+ declare interface ConvertOptions {
596
+ att?: string;
597
+ ins?: string;
598
+ text?: string;
599
+ cdata?: string;
600
+ comment?: string;
601
+ }
602
+
624
603
  declare interface CopyOperation {
625
604
  op: 'copy';
626
605
  from: string;
@@ -893,6 +872,10 @@ declare interface EventTemplateRecord {
893
872
 
894
873
  declare type ExactRecords = MiscRecords & MediaRecords & AssetRecords & MonitorRecords & StorageRecords;
895
874
 
875
+ declare type ExpandObject = {
876
+ [key: string]: any;
877
+ } | any[];
878
+
896
879
  declare interface FacebookConnectionDef extends ConnectionDef<"facebook"> {
897
880
  connection: FacebookConnectionRecord;
898
881
  }
@@ -1050,10 +1033,18 @@ declare interface FileConnectionSmbRecord extends FileConnectionBase {
1050
1033
  createFolders?: boolean;
1051
1034
  }
1052
1035
 
1036
+ declare interface FileDomainMethodsRecord {
1037
+ stop?: {
1038
+ rpcId: string;
1039
+ rpcData: unknown;
1040
+ };
1041
+ }
1042
+
1053
1043
  declare interface FileDomainRecords {
1054
1044
  ":file.replicate": FileReplicateRecord;
1055
1045
  ":file.restrictions": FileRestrictionsRecord;
1056
1046
  ":file.stats?": FileDomainStatsRecord;
1047
+ ":file.methods?": FileDomainMethodsRecord;
1057
1048
  }
1058
1049
 
1059
1050
  declare type FileDomainStatsRecord = FileStats;
@@ -2192,6 +2183,12 @@ export declare interface NxtpressionNxt {
2192
2183
  hash(value: unknown): string;
2193
2184
  }
2194
2185
 
2186
+ declare type NxtpressionSchemaProperty<Value = unknown> = {
2187
+ [K in keyof SchemaProperty<Value>]: Nxtpression<SchemaProperty<Value>[K], {
2188
+ id: string;
2189
+ }>;
2190
+ };
2191
+
2195
2192
  declare interface NxtStatusMessage {
2196
2193
  id: string;
2197
2194
  msg: string;
@@ -2428,21 +2425,77 @@ declare interface PanelDomainPanelRecord {
2428
2425
  priority?: number;
2429
2426
  editorPriority?: number;
2430
2427
  properties?: {
2431
- [key: string]: PanelProperty;
2428
+ [key: string]: PanelRootProperty;
2432
2429
  };
2433
2430
  layout?: {
2434
2431
  panel?: WidgetLayout;
2435
2432
  editor?: WidgetLayout;
2433
+ csv?: string[] | true;
2434
+ json?: string[] | true;
2435
+ xml?: string[] | true;
2436
+ rss?: string[] | true;
2436
2437
  };
2437
2438
  filter?: Nxtpression;
2438
- expand?: Nxtpression;
2439
+ expand?: Nxtpression<unknown>;
2440
+ expandSkipEmpty?: boolean;
2441
+ xml?: ReportXmlOptions;
2442
+ rss?: ReportRssOptions;
2443
+ /**
2444
+ * For reports. Only when :publish#expand.type === 'published'.
2445
+ * If an already expanded to :published record is connected to an ingestclip,
2446
+ * expand further on all :published records of type 'event' that were created
2447
+ * during the ingestclip's time range.
2448
+ *
2449
+ * The use case is to find e.g. music that was played during a broadcast of
2450
+ * an ingestclip.
2451
+ */
2452
+ expandIngestclip?: boolean;
2453
+ /**
2454
+ * For reports, when :publish#expand.type === 'published'.
2455
+ * Due to legacy reasons publishedTypes defaults to ['event'],
2456
+ * if you want all types, set publishedTypes to null.
2457
+ */
2458
+ publishedTypes?: string[] | null;
2439
2459
  }
2440
2460
 
2441
2461
  declare interface PanelDomainRecords {
2442
2462
  ":panel": PanelDomainPanelRecord;
2443
2463
  }
2444
2464
 
2445
- declare type PanelProperty<Value = unknown> = BaseSchemaProperty<Value>;
2465
+ declare interface PanelProperty<Value = unknown> {
2466
+ type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc" | undefined;
2467
+ /** User-friendly title of the property. This will be used as the field's label in the UI. */
2468
+ title?: string;
2469
+ description?: string;
2470
+ /** If present, indicates that the user must specify a value for the asset to be treated as valid. */
2471
+ required?: boolean;
2472
+ oneOf?: Array<PanelProperty>;
2473
+ anyOf?: Array<PanelProperty>;
2474
+ enum?: ReadonlyArray<Value>;
2475
+ minItems?: number;
2476
+ maxItems?: number;
2477
+ items?: PanelProperty<Value>;
2478
+ const?: Value;
2479
+ properties?: Record<string, PanelProperty<unknown>>;
2480
+ widget?: WidgetType | WidgetOptions;
2481
+ placeholder?: string;
2482
+ helpText?: string;
2483
+ invalid?: boolean;
2484
+ emptyValue?: Value;
2485
+ }
2486
+
2487
+ declare interface PanelRootProperty<Value = unknown> extends Omit<PanelProperty<Value>, "const"> {
2488
+ domain?: string;
2489
+ path?: string;
2490
+ computed?: Nxtpression<Value>;
2491
+ /** An object specifying where to index the data. Adding this will effectively make the data searchable. */
2492
+ index?: {
2493
+ /** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
2494
+ label: string;
2495
+ /** A string specifying where to store the data in the search index. Note that this should be a globally unique value in the system. Typically you'd use `{domain}.{path}` and you should prefer English in camel case */
2496
+ path: string;
2497
+ };
2498
+ }
2446
2499
 
2447
2500
  declare interface ParagraphNodeContent extends ElementNodeContent {
2448
2501
  type: "paragraph";
@@ -2784,6 +2837,8 @@ declare interface RenderDomainResultRecord {
2784
2837
  start?: number | null;
2785
2838
  end?: number | null;
2786
2839
  }>;
2840
+ timecode?: number | null;
2841
+ live?: boolean | null;
2787
2842
  result?: unknown;
2788
2843
  error?: null | Record<string, unknown> | Array<Record<string, unknown>>;
2789
2844
  extension?: string;
@@ -2899,6 +2954,7 @@ declare interface RenderDomainStatsRecord {
2899
2954
  limits?: unknown;
2900
2955
  taskset?: string;
2901
2956
  end?: number | null;
2957
+ duration?: number | null;
2902
2958
  }
2903
2959
 
2904
2960
  declare type RenderPreset = RenderPresetObject | string;
@@ -3003,6 +3059,8 @@ declare interface RenderSceneObject {
3003
3059
  proxyManifest?: string | null;
3004
3060
  proxyFile?: string | null;
3005
3061
  manifest?: string | null;
3062
+ timecode?: number;
3063
+ timezone?: string;
3006
3064
  } | null;
3007
3065
  lang?: string;
3008
3066
  subtitle?: string;
@@ -3064,6 +3122,104 @@ declare interface ReplaceOperation {
3064
3122
  value: any;
3065
3123
  }
3066
3124
 
3125
+ declare interface ReportConnectionDef extends ConnectionDef<"report"> {
3126
+ connection: ReportConnectionRecord;
3127
+ }
3128
+
3129
+ declare interface ReportConnectionRecord extends ConnectionBase {
3130
+ type?: "report";
3131
+ }
3132
+
3133
+ declare interface ReportPublishDef extends PublishDef<"report"> {
3134
+ publish: ReportPublishRecord;
3135
+ stats: ReportPublishStatsRecord;
3136
+ }
3137
+
3138
+ declare type ReportPublishExpandType = "published" | "deadlines" | "recurrence_date_range";
3139
+
3140
+ declare type ReportPublishFormat = "csv" | "json" | "xml" | "rss";
3141
+
3142
+ /**
3143
+ * A report can be downloaded from `/report/${publishId}[/${route}]/report.${format}`.
3144
+ *
3145
+ * Search query parameters:
3146
+ * - `start`: Date string parsable by `new Date()`. Overrides expand.start.
3147
+ * - `end`: Date string parsable by `new Date()`. Overrides expand.end.
3148
+ * - `token`: Unique identifier used to track report progress.
3149
+ */
3150
+ declare interface ReportPublishRecord extends PublishRecordBase {
3151
+ type?: "report";
3152
+ searchId?: string;
3153
+ /**
3154
+ * If specified, for each search hit, additional rows will be added to the
3155
+ * report, based on the expand type.
3156
+ *
3157
+ * If type: "published", the report will expand with one row per :published
3158
+ * record that refers to the search hit and is within the date range.
3159
+ * The expression context passed to the panel's computed fields
3160
+ * will be extended with a `published` object containing data from the
3161
+ * corresponding :published record. NOTE: By default it will only expand
3162
+ * :published records of type: "event", unless a `filter` expression is
3163
+ * specified on the panel.
3164
+ *
3165
+ * If type: "deadlines", the report will expand with one row per deadline
3166
+ * provided by a search hit's :asset.deadline#value array. The expression
3167
+ * context passed to the panel's computed fields will be extended with a
3168
+ * `deadline` being a Date object corresponding to the deadline value.
3169
+ *
3170
+ * If type: "recurrence_date_range", the report will expand with one row
3171
+ * per date specified by a search hit's :calendarevent record (which could
3172
+ * be a recurrence expression evaluating to multiple dates) that falls within
3173
+ * the specified date range. The expression context passed to the panel's
3174
+ * computed fields will be extended with a `calendarevent` object with
3175
+ * a `start` and `end` Date object.
3176
+ */
3177
+ expand?: {
3178
+ type?: ReportPublishExpandType | "";
3179
+ start?: string;
3180
+ end?: string;
3181
+ };
3182
+ /** Asset ID */
3183
+ panel?: string;
3184
+ /** The report can be downloaded from `/report/${publishId}[/${route}]`. */
3185
+ route?: string;
3186
+ /** Field name to sort by */
3187
+ sort?: string;
3188
+ /** Sort order */
3189
+ order?: "asc" | "desc";
3190
+ /** Used by the hub, which passes it as filename extension to the download URL */
3191
+ format?: ReportPublishFormat;
3192
+ xml?: ReportXmlOptions;
3193
+ }
3194
+
3195
+ declare interface ReportPublishStatsRecord extends PublishStatsRecordBase {
3196
+ retrieved?: {
3197
+ total?: number;
3198
+ count?: number;
3199
+ };
3200
+ }
3201
+
3202
+ declare interface ReportRssOptions extends Partial<RssOptions> {
3203
+ namespaces?: Record<string, string>;
3204
+ }
3205
+
3206
+ declare interface ReportXmlOptions {
3207
+ options?: XMLBuilderOptions;
3208
+ formatterOptions?: XMLWriterOptions;
3209
+ /**
3210
+ * Should resolve to a JS object representing the root XML schema, as readable by xmlbuilder2.
3211
+ */
3212
+ rootSchema?: Nxtpression<ExpandObject, {
3213
+ publishId: string;
3214
+ items: unknown[];
3215
+ }>;
3216
+ /**
3217
+ * Should resolve to a JS object representing the XML schema for each item, as readable by xmlbuilder2.
3218
+ * Required for output to be generated.
3219
+ */
3220
+ itemSchema?: Nxtpression<ExpandObject>;
3221
+ }
3222
+
3067
3223
  declare interface ResolvedFilePublishRender extends PublishRenderBase {
3068
3224
  name?: string;
3069
3225
  path: string;
@@ -3114,6 +3270,40 @@ declare interface RpcPermission {
3114
3270
  tags?: undefined;
3115
3271
  }
3116
3272
 
3273
+ declare interface RssAuthor {
3274
+ name?: string;
3275
+ email?: string;
3276
+ link?: string;
3277
+ avatar?: string;
3278
+ }
3279
+
3280
+ declare interface RssOptions {
3281
+ id?: string;
3282
+ title: string;
3283
+ updated?: string | number;
3284
+ generator?: string;
3285
+ language?: string;
3286
+ ttl?: number;
3287
+ stylesheet?: string;
3288
+ feed?: string;
3289
+ feedLinks?: {
3290
+ rss?: string;
3291
+ atom?: string;
3292
+ json?: string;
3293
+ [key: string]: string | undefined;
3294
+ };
3295
+ hub?: string;
3296
+ docs?: string;
3297
+ podcast?: boolean;
3298
+ category?: string;
3299
+ author?: RssAuthor;
3300
+ link?: string;
3301
+ description?: string;
3302
+ image?: string;
3303
+ favicon?: string;
3304
+ copyright?: string;
3305
+ }
3306
+
3117
3307
  declare interface SchemaDomainPanelRecord {
3118
3308
  title?: string;
3119
3309
  /**
@@ -3124,7 +3314,7 @@ declare interface SchemaDomainPanelRecord {
3124
3314
  domain?: string;
3125
3315
  priority?: number;
3126
3316
  properties?: {
3127
- [key: string]: SchemaProperty;
3317
+ [key: string]: SchemaRootProperty;
3128
3318
  };
3129
3319
  layout?: {
3130
3320
  panel?: WidgetLayout;
@@ -3136,7 +3326,33 @@ declare interface SchemaDomainRecords {
3136
3326
  ":schema": SchemaDomainPanelRecord;
3137
3327
  }
3138
3328
 
3139
- declare interface SchemaProperty<Value = unknown> extends BaseSchemaProperty<Value> {
3329
+ declare interface SchemaProperty<Value = unknown> {
3330
+ /** Specifying what type of data will be entered into the field. */
3331
+ type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc";
3332
+ /** User-friendly title of the property. This will be used as the field's label in the UI. */
3333
+ title?: string;
3334
+ description?: string;
3335
+ /** If present, indicates that the user must specify a value for the asset to be treated as valid. */
3336
+ required?: boolean;
3337
+ oneOf?: Array<SchemaProperty>;
3338
+ anyOf?: Array<SchemaProperty>;
3339
+ enum?: ReadonlyArray<Value>;
3340
+ minItems?: number;
3341
+ maxItems?: number;
3342
+ items?: SchemaProperty<Value>;
3343
+ properties?: Record<string, SchemaProperty<unknown>>;
3344
+ default?: Value;
3345
+ const?: Value;
3346
+ widget?: WidgetType | WidgetOptions;
3347
+ placeholder?: string;
3348
+ helpText?: string;
3349
+ invalid?: boolean;
3350
+ emptyValue?: Value;
3351
+ }
3352
+
3353
+ declare interface SchemaRootProperty<Value = unknown> extends NxtpressionSchemaProperty<Value> {
3354
+ domain?: string;
3355
+ path?: string;
3140
3356
  recordName?: Nxtpression<string, {
3141
3357
  id: string;
3142
3358
  }>;
@@ -3144,8 +3360,13 @@ declare interface SchemaProperty<Value = unknown> extends BaseSchemaProperty<Val
3144
3360
  id: string;
3145
3361
  value: unknown;
3146
3362
  }>;
3147
- default?: Value;
3148
- const?: Value;
3363
+ /** An object specifying where to index the data. Adding this will effectively make the data searchable. */
3364
+ index?: {
3365
+ /** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
3366
+ label: string;
3367
+ /** A string specifying where to store the data in the search index. Note that this should be a globally unique value in the system. Typically you'd use `{domain}.{path}` and you should prefer English in camel case */
3368
+ path: string;
3369
+ };
3149
3370
  }
3150
3371
 
3151
3372
  /**
@@ -3496,6 +3717,7 @@ declare interface Settings {
3496
3717
  volume?: number;
3497
3718
  muted?: boolean;
3498
3719
  graphics?: boolean;
3720
+ subtitle?: string | null;
3499
3721
  waveform?: boolean;
3500
3722
  defaultFrameRate?: number;
3501
3723
  dropFrame?: boolean;
@@ -3517,7 +3739,8 @@ declare interface Settings {
3517
3739
  preview?: boolean | "play" | "seek" | "seekplay" | "disabled";
3518
3740
  showRenderProgress?: boolean;
3519
3741
  };
3520
- timecodeReference?: string;
3742
+ showTimeCode?: boolean;
3743
+ timecodeReference?: "subclip" | "default";
3521
3744
  maxSubclipDuration?: number;
3522
3745
  rewindStep?: number;
3523
3746
  forwardStep?: number;
@@ -4563,9 +4786,9 @@ export declare interface Underscore {
4563
4786
  fetch(options?: RequestInit, suspend?: boolean): (resource: string) => NxtpressionFetch;
4564
4787
  }
4565
4788
 
4566
- declare type Union = FileConnectionDef | FacebookConnectionDef | ReutersConnectionDef | EmptyConnectionDef;
4789
+ declare type Union = FileConnectionDef | FacebookConnectionDef | ReportConnectionDef | ReutersConnectionDef | EmptyConnectionDef;
4567
4790
 
4568
- declare type Union_2 = EmptyPublishDef | YoutubePublishDef | FacebookPublishDef | FilePublishDef | FileLegacyPublishDef;
4791
+ declare type Union_2 = EmptyPublishDef | ReportPublishDef | YoutubePublishDef | FacebookPublishDef | FilePublishDef | FileLegacyPublishDef;
4569
4792
 
4570
4793
  declare interface Unsubscribable {
4571
4794
  unsubscribe(): void;
@@ -4740,6 +4963,47 @@ declare interface WidgetOptions {
4740
4963
 
4741
4964
  declare type WidgetType = string;
4742
4965
 
4966
+ /**
4967
+ * @link https://oozcitak.github.io/xmlbuilder2/builder-functions.html#builder-options
4968
+ */
4969
+ declare interface XMLBuilderOptions {
4970
+ [key: string]: unknown;
4971
+ version?: "1.0";
4972
+ encoding?: string | undefined;
4973
+ standalone?: boolean | undefined;
4974
+ keepNullNodes?: boolean;
4975
+ keepNullAttributes?: boolean;
4976
+ ignoreConverters?: boolean;
4977
+ skipWhitespaceOnlyText?: boolean;
4978
+ convert?: ConvertOptions;
4979
+ defaultNamespace?: {
4980
+ ele?: undefined | null | string;
4981
+ att?: undefined | null | string;
4982
+ };
4983
+ namespaceAlias?: {
4984
+ [key: string]: string | null | undefined;
4985
+ };
4986
+ invalidCharReplacement?: string | ((char: string, offset: number, str: string) => string) | undefined;
4987
+ parser?: any;
4988
+ }
4989
+
4990
+ /**
4991
+ * @link https://oozcitak.github.io/xmlbuilder2/serialization.html#serialization-settings
4992
+ */
4993
+ declare interface XMLWriterOptions {
4994
+ wellFormed?: boolean;
4995
+ format?: "xml";
4996
+ headless?: boolean;
4997
+ prettyPrint?: boolean;
4998
+ indent?: string;
4999
+ newline?: string;
5000
+ offset?: number;
5001
+ width?: number;
5002
+ allowEmptyTags?: boolean;
5003
+ indentTextOnlyNodes?: boolean;
5004
+ spaceBeforeSlash?: boolean;
5005
+ }
5006
+
4743
5007
  /**
4744
5008
  * A base64 encoded string representing a complete Yjs document state.
4745
5009
  * This is created using `Y.encodeStateAsUpdate()` and is used for
@@ -2,11 +2,13 @@ import type { FileConnectionDef } from './file/index.ts';
2
2
  export * from './file/index.ts';
3
3
  import type { FacebookConnectionDef } from './facebook.ts';
4
4
  export * from './facebook.ts';
5
+ import type { ReportConnectionDef } from './report.ts';
6
+ export * from './report.ts';
5
7
  import type { ReutersConnectionDef } from './reuters.ts';
6
8
  export * from './reuters.ts';
7
9
  import type { EmptyConnectionDef } from './empty.ts';
8
10
  export * from './empty.ts';
9
- type Union = FileConnectionDef | FacebookConnectionDef | ReutersConnectionDef | EmptyConnectionDef;
11
+ type Union = FileConnectionDef | FacebookConnectionDef | ReportConnectionDef | ReutersConnectionDef | EmptyConnectionDef;
10
12
  export type ConnectionRecord = Union["connection"];
11
13
  export type MethodsRecord = Union["methods"];
12
14
  export type StatsRecord = Union["stats"];
@@ -1,4 +1,5 @@
1
1
  export * from "./file/index.js";
2
2
  export * from "./facebook.js";
3
+ export * from "./report.js";
3
4
  export * from "./reuters.js";
4
5
  export * from "./empty.js";
@@ -0,0 +1,7 @@
1
+ import type { ConnectionDef, ConnectionBase } from './index.ts';
2
+ export interface ReportConnectionDef extends ConnectionDef<"report"> {
3
+ connection: ReportConnectionRecord;
4
+ }
5
+ export interface ReportConnectionRecord extends ConnectionBase {
6
+ type?: "report";
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ export interface FileDomainRecords {
3
3
  ":file.replicate": FileReplicateRecord;
4
4
  ":file.restrictions": FileRestrictionsRecord;
5
5
  ":file.stats?": FileDomainStatsRecord;
6
+ ":file.methods?": FileDomainMethodsRecord;
6
7
  }
7
8
  export interface FileReplicateRecord {
8
9
  replicas: string[];
@@ -24,3 +25,9 @@ export interface FileRestrictionsRecord {
24
25
  };
25
26
  }
26
27
  export type FileDomainStatsRecord = FileStats;
28
+ export interface FileDomainMethodsRecord {
29
+ stop?: {
30
+ rpcId: string;
31
+ rpcData: unknown;
32
+ };
33
+ }
@@ -1,4 +1,4 @@
1
- import type { Nxtpression, PanelProperty, WidgetLayout } from '../../common/index.ts';
1
+ import type { Nxtpression, PanelRootProperty, WidgetLayout, ReportRssOptions, ReportXmlOptions } from '../../common/index.ts';
2
2
  export interface PanelDomainRecords {
3
3
  ":panel": PanelDomainPanelRecord;
4
4
  }
@@ -12,12 +12,35 @@ export interface PanelDomainPanelRecord {
12
12
  priority?: number;
13
13
  editorPriority?: number;
14
14
  properties?: {
15
- [key: string]: PanelProperty;
15
+ [key: string]: PanelRootProperty;
16
16
  };
17
17
  layout?: {
18
18
  panel?: WidgetLayout;
19
19
  editor?: WidgetLayout;
20
+ csv?: string[] | true;
21
+ json?: string[] | true;
22
+ xml?: string[] | true;
23
+ rss?: string[] | true;
20
24
  };
21
25
  filter?: Nxtpression;
22
- expand?: Nxtpression;
26
+ expand?: Nxtpression<unknown>;
27
+ expandSkipEmpty?: boolean;
28
+ xml?: ReportXmlOptions;
29
+ rss?: ReportRssOptions;
30
+ /**
31
+ * For reports. Only when :publish#expand.type === 'published'.
32
+ * If an already expanded to :published record is connected to an ingestclip,
33
+ * expand further on all :published records of type 'event' that were created
34
+ * during the ingestclip's time range.
35
+ *
36
+ * The use case is to find e.g. music that was played during a broadcast of
37
+ * an ingestclip.
38
+ */
39
+ expandIngestclip?: boolean;
40
+ /**
41
+ * For reports, when :publish#expand.type === 'published'.
42
+ * Due to legacy reasons publishedTypes defaults to ['event'],
43
+ * if you want all types, set publishedTypes to null.
44
+ */
45
+ publishedTypes?: string[] | null;
23
46
  }
@@ -7,9 +7,11 @@ import type { FileLegacyPublishDef } from './file-legacy.ts';
7
7
  export * from './file-legacy.ts';
8
8
  import type { FilePublishDef } from './file.ts';
9
9
  export * from './file.ts';
10
+ import type { ReportPublishDef } from './report.ts';
11
+ export * from './report.ts';
10
12
  import type { YoutubePublishDef } from './youtube.ts';
11
13
  export * from './youtube.ts';
12
- type Union = EmptyPublishDef | YoutubePublishDef | FacebookPublishDef | FilePublishDef | FileLegacyPublishDef;
14
+ type Union = EmptyPublishDef | ReportPublishDef | YoutubePublishDef | FacebookPublishDef | FilePublishDef | FileLegacyPublishDef;
13
15
  export type PublishDefOfType<T extends string | null> = Union & {
14
16
  type: T;
15
17
  };
@@ -2,4 +2,5 @@ export * from "./empty.js";
2
2
  export * from "./facebook.js";
3
3
  export * from "./file-legacy.js";
4
4
  export * from "./file.js";
5
+ export * from "./report.js";
5
6
  export * from "./youtube.js";
@@ -0,0 +1,70 @@
1
+ import type { PublishDef, PublishRecordBase, PublishStatsRecordBase } from './index.ts';
2
+ import type { ReportXmlOptions } from '../../../common/report.ts';
3
+ export interface ReportPublishDef extends PublishDef<"report"> {
4
+ publish: ReportPublishRecord;
5
+ stats: ReportPublishStatsRecord;
6
+ }
7
+ export type ReportPublishFormat = "csv" | "json" | "xml" | "rss";
8
+ export declare const isReportPublishFormat: (input: unknown) => input is ReportPublishFormat;
9
+ export type ReportPublishExpandType = "published" | "deadlines" | "recurrence_date_range";
10
+ export declare const isReportPublishExpandType: (input: unknown) => input is ReportPublishExpandType;
11
+ /**
12
+ * A report can be downloaded from `/report/${publishId}[/${route}]/report.${format}`.
13
+ *
14
+ * Search query parameters:
15
+ * - `start`: Date string parsable by `new Date()`. Overrides expand.start.
16
+ * - `end`: Date string parsable by `new Date()`. Overrides expand.end.
17
+ * - `token`: Unique identifier used to track report progress.
18
+ */
19
+ export interface ReportPublishRecord extends PublishRecordBase {
20
+ type?: "report";
21
+ searchId?: string;
22
+ /**
23
+ * If specified, for each search hit, additional rows will be added to the
24
+ * report, based on the expand type.
25
+ *
26
+ * If type: "published", the report will expand with one row per :published
27
+ * record that refers to the search hit and is within the date range.
28
+ * The expression context passed to the panel's computed fields
29
+ * will be extended with a `published` object containing data from the
30
+ * corresponding :published record. NOTE: By default it will only expand
31
+ * :published records of type: "event", unless a `filter` expression is
32
+ * specified on the panel.
33
+ *
34
+ * If type: "deadlines", the report will expand with one row per deadline
35
+ * provided by a search hit's :asset.deadline#value array. The expression
36
+ * context passed to the panel's computed fields will be extended with a
37
+ * `deadline` being a Date object corresponding to the deadline value.
38
+ *
39
+ * If type: "recurrence_date_range", the report will expand with one row
40
+ * per date specified by a search hit's :calendarevent record (which could
41
+ * be a recurrence expression evaluating to multiple dates) that falls within
42
+ * the specified date range. The expression context passed to the panel's
43
+ * computed fields will be extended with a `calendarevent` object with
44
+ * a `start` and `end` Date object.
45
+ */
46
+ expand?: {
47
+ type?: ReportPublishExpandType | "";
48
+ start?: string;
49
+ end?: string;
50
+ };
51
+ /** Asset ID */
52
+ panel?: string;
53
+ /** The report can be downloaded from `/report/${publishId}[/${route}]`. */
54
+ route?: string;
55
+ /** Field name to sort by */
56
+ sort?: string;
57
+ /** Sort order */
58
+ order?: "asc" | "desc";
59
+ /** Used by the hub, which passes it as filename extension to the download URL */
60
+ format?: ReportPublishFormat;
61
+ xml?: ReportXmlOptions;
62
+ }
63
+ export declare const isReportPublishRecord: (input: unknown) => input is ReportPublishRecord;
64
+ export declare const assertReportPublishRecord: (input: unknown) => ReportPublishRecord;
65
+ export interface ReportPublishStatsRecord extends PublishStatsRecordBase {
66
+ retrieved?: {
67
+ total?: number;
68
+ count?: number;
69
+ };
70
+ }