@3e/sqa-common 7.4.0-2 → 7.4.0-4

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/index.d.ts CHANGED
@@ -1,646 +1,15 @@
1
- import {
2
- ApiFn,
3
- ColorScheme,
4
- ColorSettings,
5
- ColorSchemeValue,
6
- DashboardLevel,
7
- EmptyViewOptions,
8
- Granularity,
9
- InitialisationConfig,
10
- Level,
11
- MeasurementsTable,
12
- Period,
13
- SQView,
14
- Timezone,
15
- TimezoneValue,
16
- TokenThunk,
17
- ViewType,
18
- VisualisationOptions,
19
- Visualization,
20
- StackingOption,
21
- TimezoneMode,
22
- Representation,
23
- LdTypeOption,
24
- LevelValue,
25
- Container,
26
- ContainerValue,
27
- Template,
28
- ISODateString,
29
- PeriodTimeMode,
30
- Dataset,
31
- SaveDataJobResponse,
32
- LdTypeValue,
33
- DatasetOptions,
34
- DatasetTemplateSpec,
35
- PacoViewParameters,
36
- Parameter,
37
- ShortLDTypeValue,
38
- SaveDataArguments,
39
- ViewExportFormat
40
- } from './types'
41
-
42
1
  /**
43
2
  * Type declarations for the @3e/sqa-common module
44
3
  */
45
4
  declare module '@3e/sqa-common' {
46
5
  /**
47
- * Type definitions for all the API
6
+ * Type definitions exist in the SQP project packages/types
48
7
  */
49
- interface CommonLib {
50
- /**
51
- * Initialise the SQA Common library with a `apiFn` function.
52
- * Make sure to call `wrapRefresh` before calling this function
53
- * @param config
54
- */
55
- init(config: InitialisationConfig): Promise<void>
56
-
57
- /**
58
- * Wraps the `apiFn` with retry capabilities and refreshes token that was
59
- * received with the `getToken` thunk
60
- * @param apiFn - The function to call the SQA endpoints
61
- * @param getToken - function with no arguments that returns the JWT token
62
- */
63
- wrapRefresh(
64
- apiFn: ApiFn,
65
- getToken: TokenThunk,
66
- ): {apiFn: ApiFn; resetFn: () => void}
67
-
68
- /**
69
- *
70
- */
71
- logout(): void
72
-
73
- /**
74
- * Returns configuration for a new empty view
75
- * @param viewOptions - parameters for the view
76
- */
77
- newEmptyView(viewOptions: EmptyViewOptions): SQView
78
-
79
- /**
80
- * Returns the type for the given view
81
- * @param view SQView
82
- */
83
- getViewType(view: SQView): ViewType
84
-
85
- /**
86
- * Sets a new type for the view
87
- @param view - view on which to change type
88
- @param viewType - new view type
89
- */
90
- setViewType(view: SQView, viewType: ViewType): SQView
91
-
92
- /**
93
- * Get title of the view
94
- * @param view - the SQView
95
- */
96
- getTitle(view: SQView): string
97
-
98
- /**
99
- * Set title of the view. Returns updated SQView
100
- * @param view - the SQView
101
- * @param value - the new title
102
- */
103
- setTitle(view: SQView, value: string): SQView
104
-
105
- /**
106
- * Get description of the view
107
- * @param view - the SQView
108
- */
109
- getDescription(view: SQView): string
110
-
111
- /**
112
- * Set description of a view. Returns updated SQView
113
- * @param view - the SQView
114
- * @param description - the new description
115
- */
116
- setDescription(view: SQView, description: string): SQView
117
-
118
- /**
119
- * Get colorScheme of the view
120
- * @param view - the SQView
121
- */
122
- getColorScheme(view: SQView): string
123
-
124
- /**
125
- * Set colorScheme of a view. Returns updated SQView
126
- * @param view - the SQView
127
- * @param colorScheme - the new description
128
- */
129
- setColorScheme(view: SQView, colorScheme: ColorSchemeValue): SQView
130
-
131
- /**
132
- * Constructs an initial visualization for the view. Returns a promise
133
- * @param view - the SQView
134
- * @param options - creation options
135
- */
136
- getVisualization(
137
- view: SQView,
138
- options: VisualisationOptions,
139
- ): Promise<Visualization>
140
-
141
- /**
142
- * Populates a visualization with data, using the default `append-data` to append each page.
143
- * @param visualization - the visualization to be populated
144
- * @param callback - Callback function called with the populated viz when the operation is done
145
- *
146
- * @returns a function to cancel the operation
147
- */
148
- populateVisualization(
149
- visualization: Visualization,
150
- callback: (visualization: Visualization) => void,
151
- ): () => void
152
-
153
- /**
154
- * @param visualization - the visualization to be populated
155
- *
156
- * @returns A promise with the populated visualization
157
- */
158
- populateVisualization(visualization: Visualization): Promise<Visualization>
159
-
160
- /**
161
- * @param visualization - the visualization to be populated
162
- * @param callback - Callback function called with the populated viz when the operation is done
163
- * @param cancelPromise - A promise that resolves to an object with a `cancelled?` key
164
- * if this promise resolves before the operation is done, the operation is cancelled
165
- *
166
- * @returns A promise with the populated visualization
167
- */
168
- populateVisualization(
169
- visualization: Visualization,
170
- callback: (visualization: Visualization) => void,
171
- cancelPromise: Promise<{'cancelled?': boolean}>,
172
- ): Promise<Visualization>
173
-
174
- /**
175
- * Creates a table for measurements, for a single selected object
176
- *
177
- * @param object - the object reference
178
- * @param granularity - the granularity for the data fetched
179
- * @param period - the period for the data fetched
180
- * @param callback - Callback function called with the populated table
181
- *
182
- * @returns a function to cancel the operation
183
- */
184
- getMeasurements(
185
- object: string,
186
- granularity:
187
- | 'raw'
188
- | 'scaled'
189
- | 'normalised'
190
- | {start: number; end: number},
191
- period: Period,
192
- callback: (result: MeasurementsTable) => void,
193
- ): () => void
194
-
195
- /**
196
- * Creates a table for latest measurements, for a single selected object.
197
- * Only returns the latest measurements for the given object.
198
- * Currently, the period is hardcoded to 120 minutes
199
- *
200
- * @param object - the object reference
201
- * @param granularity - the granularity for the data fetched
202
- * @param period - the period for the data fetched (currently hardcoded to 120 minutes)
203
- * pass null to use the default period
204
- * @param callback - Callback function called with the populated table
205
- *
206
- * @returns a function to cancel the operation
207
- */
208
- getLatestMeasurements(
209
- object: string,
210
- granularity: 'raw' | 'scaled' | 'normalised',
211
- period: Period | null,
212
- callback: (result: MeasurementsTable) => void,
213
- ): () => void
214
-
215
- /**
216
- * Returns measurable levels contained in a dashboard level
217
- * @param dashboardLevel - dashboard level. See type for possible values
218
- * @throws Error - If input is not contained in the possible dashboard levels
219
- * @deprecated Use getMeasurableSubLevelsByLdType instead
220
- */
221
- getMeasurableSubLevels(dashboardLevel: DashboardLevel): Level[]
222
-
223
- /**
224
- * Returns measurable levels contained in a dashboard level for a given ldType
225
- * @param ldType - ldType of the dashboard level
226
- * @throws Error - If input is not contained in the possible dashboard levels
227
- */
228
- getMeasurableSubLevelsByLDType(ldType: string): Level[]
229
-
230
- /**
231
- * Returns the granularity for the view
232
- * @param view
233
- */
234
- getGranularityParameter(view: SQView): Granularity
235
-
236
- /**
237
- * Returns the granularity for the view
238
- * @param view - the view to modify
239
- * @param granularity - the new granularity
240
- */
241
- setGranularityParameter(view: SQView, granularity: Granularity): SQView
242
-
243
- /**
244
- * Returns the object parameters for a view. This is the dynamic object of the view
245
- * If the view only has hardcoded objects, this will return an empty array
246
- *
247
- * Use this to find if the view has a dynamic object
248
- * @param view
249
- */
250
- getObjectParameters(view: SQView):
251
- | [
252
- {
253
- id: string
254
- label: string
255
- ldType: ShortLDTypeValue
256
- level: ShortLDTypeValue
257
- container: string | null
258
- value: string
259
- },
260
- ]
261
- | []
262
-
263
- /**
264
- * Sets the object parameter with the given id. Used to set the dynamic object of the view
265
- * @param view - SQView
266
- * @param id - The ID of the parameter
267
- * @param value - Value of the parameter
268
- */
269
- setObjectParameter(view: SQView, id: string, value: string): SQView
270
-
271
- DataTimezoneModes: [
272
- {value: 'user'; label: 'Display data in my own timezone'},
273
- {value: 'plant'; label: 'Display data in the timezone of the plant'},
274
- ]
275
-
276
- ShowNullsAsOptions: [
277
- {value: 'no'; label: 'No'},
278
- {value: 'normal'; label: 'Normal'},
279
- {value: 'percent'; label: 'Percent'},
280
- ]
281
-
282
- ViewTypes: {label: string; value: ViewType}[]
283
-
284
- /**
285
- * A collection of all timezones in the format {label, value}
286
- */
287
- Timezones: Timezone[]
288
-
289
- /**
290
- * Sets the user timezone
291
- * @param timezone - The value for the new timezone
292
- */
293
- setUserTimezone(timezone: TimezoneValue): void
294
-
295
- /**
296
- * Sets the data timezone mode to either user or plant
297
- * @param mode - the timezone mode ('user' | 'data')
298
- */
299
- setDataTimezoneMode(mode: TimezoneMode): void
300
-
301
- /**
302
- * Returns current available colorSchemes
303
- */
304
- getColorSchemes(): ColorScheme[]
305
-
306
- /**
307
- * Returns the possible color settings for a certain view type
308
- * @param viewType
309
- */
310
- getColorSettings(viewType: ViewType): ColorSettings[]
311
-
312
- getColorSettingsCssStyle(colorSetting: ColorSettings):
313
- | {
314
- backgroundColor: string
315
- }
316
- | {
317
- backgroundImage: string
318
- }
319
-
320
- /**
321
- * Sets the colorscheme of a view
322
- * @param view the view to be modified
323
- * @param colorScheme - the new colorscheme
324
- */
325
- setViewColorScheme(view: SQView, colorScheme: string): SQView
326
-
327
- /**
328
- * Array with available levels
329
- *
330
- * !! Only usable after `init` has been called
331
- */
332
- getLevels(): Level[]
333
-
334
- StackingOptions: StackingOption[]
8
+ interface SqaCommonLib {}
335
9
 
336
- Representations: Representation[]
337
-
338
- /**
339
- *
340
- * Gets the container logical devices types to populate
341
- * @param level - level means container
342
- */
343
- getContainersLdTypes(level: LevelValue): Promise<LdTypeOption[]>
344
-
345
- /**
346
- * Based on the selected level and the Selected Logical Device type, returns
347
- * available Plants
348
- * @param selectedLevel
349
- * @param selectedContainerLdType
350
- */
351
- getContainers(
352
- selectedLevel: LevelValue,
353
- selectedContainerLdType?: string,
354
- ): Promise<Container[]>
355
-
356
- /**
357
- * Get all available templates for the current selection
358
- * @param view
359
- * @param specification
360
- */
361
- getTemplates(
362
- view: SQView,
363
- specification: {
364
- selectedLevel: LevelValue
365
- selectedContainer?: ContainerValue
366
- },
367
- ): Promise<Template[]>
368
-
369
- /**
370
- * Sets the unit scaling for a view.
371
- * All indicators with that unit will be modified. Returns the updated view
372
- * @param view - The SQView
373
- * @param unitKey - the
374
- * @param unitScaling
375
- */
376
- setUnitScaling(
377
- view: SQView,
378
- unitKey: string,
379
- unitScaling: {min?: number; max?: number},
380
- ): SQView
381
-
382
- /**
383
- * Gets the unit axis scaling for the given unit
384
- * @param view - The SQView
385
- * @param unitKey - the
386
- */
387
- getUnitScaling(
388
- view: SQView,
389
- unitKey: string,
390
- ): {
391
- min: number
392
- max: number
393
- }
394
-
395
- /**
396
- * Sets the start date of the period
397
- * @param view - SQView
398
- * @param value - ISODateString(YYYY-MM-DDTHH:mm:ss.SSS).
399
- */
400
- setPeriodStart(view: SQView, value: ISODateString): SQView
401
-
402
- /**
403
- * Sets the end date of the period
404
- * @param view - SQView
405
- * @param value - ISODateString(YYYY-MM-DDTHH:mm:ss.SSS).
406
- */
407
- setPeriodEnd(view: SQView, value: ISODateString): SQView
408
-
409
- /**
410
- * Sets the period of the view to the next period. This will automatically make it a `custom` period
411
- * @param view - The View
412
- */
413
- setNextPeriod(view: SQView): SQView
414
-
415
- /**
416
- * Sets the period of the view to the previous period. This will automatically make it a `custom` period type
417
- * @param view - The View
418
- */
419
- setPreviousPeriod(view: SQView): SQView
420
-
421
- /**
422
- * Set the period type for the view
423
- * @param view - SQView
424
- * @param value - the new period
425
- */
426
- setPeriodParameter(view: SQView, value: Period): SQView
427
-
428
- /**
429
- * Get the period for the view
430
- * @param view - SQView
431
- */
432
- getPeriodParameter(view: SQView): Period
433
-
434
- /**
435
- * Sets the time mode for the period (absolute/local)
436
- * @param view
437
- * @param periodTimeMode
438
- */
439
- setPeriodTimeMode(view: SQView, periodTimeMode: PeriodTimeMode): SQView
440
-
441
- /**
442
- * Returns the period for the view with all related data
443
- * @param view
444
- */
445
- getPeriodParameterWithRange(view: SQView): {
446
- period: Period
447
- start: ISODateString
448
- end: ISODateString
449
- periodTimeMode: PeriodTimeMode
450
- }
451
-
452
- /**
453
- * Gets the datasets (e.g. for a legend).
454
- * - resolve-parameters (set to true to expand the templates to all objects)
455
- * - on-error (set to inline to get errors, inline, or throw to throw)
456
- * @param view
457
- * @param opts
458
- */
459
- getDatasets(view: SQView, opts: getDatasetsOptions): Promise<Dataset[]>
460
-
461
- /**
462
- * Adds a dataset to the view using a fixed set of objects.
463
- * Removes any duplicate object indicator pairs
464
- * @param view - The SQView
465
- * @param objects - Selected Logical Device(s)
466
- * @param indicators - Selected indicators
467
- * @param options
468
- */
469
- addEnumDataset(
470
- view: SQView,
471
- objects: string[],
472
- indicators: [string],
473
- options: DatasetOptions,
474
- ): SQView
475
-
476
- addTemplateDataset(
477
- view: SQView,
478
- spec: DatasetTemplateSpec,
479
- indicators: [string],
480
- opts: DatasetOptions,
481
- ): SQView
482
-
483
- /**
484
- * Remove a dataset from the view
485
- * @param view the view to be modified
486
- * @param id the id of the dataset
487
- */
488
- removeDataset(view: SQView, id: string): SQView
489
-
490
- /**
491
- * Set particular options on a dataset for a view
492
- * @param view - the view to be updated
493
- * @param id - the id of the dataset in the view body
494
- * @param options - the new options
495
- *
496
- * @returns The updated view
497
- */
498
- setDatasetOptions(view: SQView, id: string, options: DatasetOptions): SQView
499
-
500
- /**
501
- * Returns the type of picker needed for the granularity
502
- * @param granularity
503
- */
504
- getClockOrCalendarMode(granularity: Granularity): 'clock' | 'calendar'
505
-
506
- /**
507
- * Returns the type of picker needed for the granularity
508
- * @param granularity
509
- */
510
- getTimeMode(granularity: Granularity): 'clock' | 'calendar'
511
-
512
- /**
513
- * Adds the statistics alongside the objects in the dataset
514
- * @param datasets - datasets to be updated
515
- * @param visualization - Visualization to be added to datasets
516
- */
517
- withStatistics(datasets: Dataset[], visualization: Visualization): Dataset[]
518
-
519
- levelToLdTypeAndModel(level: LevelValue): {ldType: string; model: string}
520
-
521
- viewVariablesRefCategories(viewParameters: PacoViewParameters): any
522
-
523
- /**
524
- * Update a visualization
525
- * @param visualization
526
- */
527
- updateVisualization(visualization: Visualization): Visualization
528
-
529
- /**
530
- * Create a SAVE_DATA job request for a visualization. After a job is
531
- * successfully created, a *JobUrl* is returned to be polled for a status
532
- * on the job
533
- *
534
- * @param visualization - The visualization to be saved in a .csv format
535
- * @param filename - the name of the csv.zip file to be downloaded
536
- * @param format - the format of the file to be downloaded. Default is *text/csv*
537
- * @param compression - the compression used for export. Default is "zip"
538
- *
539
- * @throws An error in case the provided parameters were incorrect. Wrap the
540
- * request inside a `try-catch` block
541
- */
542
- createSaveDataJob(
543
- visualization: Visualization,
544
- filename: string,
545
- format?: ViewExportFormat,
546
- compression?: "none" | "zip"): Promise<string>
547
-
548
- /**
549
- * Extract arguments to create a `save_data` job for a view
550
- * @param view - the view to save data for
551
- * @param filename - the name of the export file. Defaults to the view title
552
- */
553
- viewToSaveDataArguments(view: SQView): Promise<SaveDataArguments>
554
- viewToSaveDataArguments(view: SQView, filename: string): Promise<SaveDataArguments>
555
-
556
- /**
557
- * Used for polling the SQA API for the job status.
558
- *
559
- * Use the jobUrl returned from `createSaveDataJob` and poll until `status` is `terminated`
560
- * @param jobUrl
561
- *
562
- * @throws An error in case something goes wrong with the request or the job does not
563
- * exist. Wrap the call inside a `try-catch` block
564
- */
565
- checkJobStatus(jobUrl: string): Promise<SaveDataJobResponse>
566
-
567
- /**
568
- * Returns the parameters of a view
569
- * @param view
570
- */
571
- getViewParameters(view: SQView): Parameter[]
572
-
573
- /**
574
- * Generate a new password for the user
575
- *
576
- * The Password will:
577
- * - be between 12 and 100 characters
578
- * - contain at least one lower-case character
579
- * - contain at least one upper-case character
580
- * - contain at least one digit
581
- * - contain at least one special character ("!%&@#$^*?_~-")
582
- *
583
- */
584
- generatePassword(): string
585
-
586
- /**
587
- * Compute the total number of data-points for a view.
588
- * Used to determine if a view is too large to be rendered
589
- * and should be saved as a CSV instead
590
- *
591
- * ** Returns a promise **
592
- *
593
- * @param view - The view to be computed
594
- */
595
- getNumberOfDataPoints(view: SQView): Promise<{
596
- intervals: number
597
- dataPoints: number
598
- datasets: number
599
- }>
600
-
601
- /**
602
- * Convert a Ref Category to a Logical Device Type.
603
- *
604
- * Returns null if no such conversion is possible.
605
- *
606
- * @param refCategory - The Ref Category to convert (e.g. nacelles)
607
- */
608
- convertRefCategoryToLDType(refCategory: string): string | null
609
-
610
- /**
611
- * Convert a Logical Device Type to a Ref Category.
612
- *
613
- * Returns null if no such conversion is possible.
614
- *
615
- * @param ldType - The Logical Device Type to convert. Accepts both short
616
- * form (e.g. 'inverter') or full SQID (e.g. '/sq/ld_type/inverter')
617
- */
618
- convertLDTypeToRefCategory(ldType: LdTypeValue): string | null
619
-
620
- /**
621
- * Make a Ref from an LD Type and a SQID
622
- *
623
- * Returns null if it is not possible to create a Ref from the
624
- * provided data (e.g. when the ldType does not correspond to a Ref Category).
625
- *
626
- * @param ldType - The Logical Device Type of the object. Accepts both short
627
- * form (e.g. 'inverter') or full SQID (e.g. '/sq/ld_type/inverter')
628
- * @param sqid - The SQID of the object
629
- */
630
- refFromLDTypeAndSQID(ldType: LdTypeValue, sqid: string): string | null
631
-
632
- /**
633
- * Returns the refresh period for the view in milliseconds, or null if the view should not be refreshed
634
- * @param view - the view for which to receive the refresh period
635
- */
636
- refreshPeriod(view: SQView): number | null
637
- }
638
-
639
- export const sqa: {
640
- common: CommonLib
10
+ type SQA = {
11
+ common: SqaCommonLib
641
12
  }
642
13
 
643
- export * from './types'
644
-
645
- export default sqa
14
+ export const sqa: SQA
646
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3e/sqa-common",
3
- "version": "7.04.0-2",
3
+ "version": "7.04.0-4",
4
4
  "description": "SynaptiQ utilities package",
5
5
  "main": "sqa_common.js",
6
6
  "dependencies": {
package/sqa_common.js CHANGED
@@ -1297,7 +1297,7 @@ function(){return new FI(new X(null,1,5,Y,[n+1],null),null,null,null)})}switch(w
1297
1297
  function HY(a,b){function c(){return ts.g(Kj.h(d,function(e){e=T(e);var f=y(e,vw),g=y(e,ts),h=y(e,pB);return ic(g)?kg.l(e,zF,!1,I([ts,mH.h(uH(null),function(){return mH.h(uH(f.m?f.m():f.call(null)),function(k){return mH.h(uH(Kj.l(d,kg,zF,!0,I([pB,function(){var l=sy.g(iE.g(aX(k)));return v(l)?l:h}()]))),function(){return uH(k)})})})])):e}))}var d=Ij(new u(null,1,[vw,b],null));return new u(null,2,[fy,GY(function(e,f){return mH.h(uH(null),function(){return mH.h(uH(c()),function(g){var h=uH;var k=sy.g(iE.g(aX(g)));
1298
1298
  v(k)&&(g=tk.O(aX(f),Bx,kg,"Authorization",["Bearer ",x.g(k)].join("")),g=yn.g?yn.g(g):yn.call(null,g),g=a.h?a.h(e,g):a.call(null,e,g));return h(g)})})},function(){return Kj.h(d,function(e){e=T(e);var f=y(e,ts),g=y(e,zF),h=y(e,pB);if(!(null!=f?q===f.vi||(f.Fc?0:qc(hH,f)):qc(hH,f)))throw Error("Assert failed: (p/promise? promise)");ic(g)||(ic(h)?e=og.l(e,ts,I([zF])):(f=kg.l,h=new u(null,3,[Ts,QC,iE,new u(null,1,[sy,h],null),Bx,new u(null,1,["Content-Type","application/json"],null)],null),h=yn.g?yn.g(h):
1299
1299
  yn.call(null,h),h=a.h?a.h("/token/refresh",h):a.call(null,"/token/refresh",h),e=f.call(kg,e,zF,!1,I([ts,h]))));return e})}),Bp,function(){return Jj(d,new u(null,1,[vw,b],null))}],null)}if("undefined"===typeof WI||"undefined"===typeof XI||"undefined"===typeof RW||"undefined"===typeof IY)var IY=null;
1300
- function JY(a,b){b=T(b);var c=mf(b,Ts,"GET"),d=y(b,GB),e=y(b,iE);b=y(b,Bx);var f=fm.l(I([b,new u(null,1,["X-SQA-Common-Version","7.04.0-2"],null)])),g=new KH,h=IY;v(h)?xI.h(function(){if(v(d)){var k=x.g(a);var l=x,n=l.g,p=yn(d),r=[],w;for(w in p)Ja(w,p[w],r);k=[k,"?",n.call(l,r.join("\x26"))].join("")}else k=a;l={method:c,headers:yn(f),body:yn(e)};return h.h?h.h(k,l):h.call(null,k,l)}(),function(k){return DI(g,Dn(k,I([En,!0])))}):xH(g,po("Api fn not set",Qi));return g}
1300
+ function JY(a,b){b=T(b);var c=mf(b,Ts,"GET"),d=y(b,GB),e=y(b,iE);b=y(b,Bx);var f=fm.l(I([b,new u(null,1,["X-SQA-Common-Version","7.04.0-4"],null)])),g=new KH,h=IY;v(h)?xI.h(function(){if(v(d)){var k=x.g(a);var l=x,n=l.g,p=yn(d),r=[],w;for(w in p)Ja(w,p[w],r);k=[k,"?",n.call(l,r.join("\x26"))].join("")}else k=a;l={method:c,headers:yn(f),body:yn(e)};return h.h?h.h(k,l):h.call(null,k,l)}(),function(k){return DI(g,Dn(k,I([En,!0])))}):xH(g,po("Api fn not set",Qi));return g}
1301
1301
  var KY=Fn(JY),LY=function LY(a){switch(arguments.length){case 2:return LY.h(arguments[0],arguments[1]);case 3:return LY.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",x.g(arguments.length)].join(""));}};LY.h=function(a,b){return LY.j(a,b,null)};
1302
1302
  LY.j=function(a,b,c){c=T(c);var d=y(c,BE),e=y(c,Oq),f=rk(b,new X(null,2,5,Y,[GB,$p],null),!0),g=function(){function h(k,l){v(e)?(k=new X(null,2,5,Y,[e,JY(k,l)],null),k=Bc(lj.h(uH,k)),k=eI(k)):k=JY(k,l);return k}return xh.g?xh.g(h):xh.call(null,h)}();return wI(function(h,k){var l=function w(p,r){return BI(function(A,C){return null!=C?k.g?k.g(C):k.call(null,C):A instanceof FI?(zH(function(){return Ji(w,rt.g(A))}),null):h.g?h.g(A):h.call(null,A)},mH.h(uH(null),function(){return mH.h(uH(p),function(A){return mH.h(uH(r),
1303
1303
  function(C){var F=uH;var O=T(C);C=y(O,on);var U=y(O,iE);O=y(O,WF);if(v(O))throw po("API call cancelled",new u(null,1,[wr,Ms],null));if(pf.h(C,200))O=T(U),C=y(O,VG),U=y(O,Ez),O=y(O,Tx),O=pk(O,new X(null,2,5,Y,[as,tz],null)),v(d)&&(d.g?d.g(C):d.call(null,C)),v(U)?(U=Y,C=lk.h(A,C),O=rk(f,new X(null,2,5,Y,[GB,tz],null),O),O=g.h?g.h(a,O):g.call(null,a,O),C=new FI(new X(null,2,5,U,[C,O],null),null,null,null)):C=lk.h(A,C);else throw po(["Non 200 status code returned in paged api call for ",x.g(a)].join(""),