@casual-simulation/aux-runtime 3.6.0 → 3.7.0-alpha.16977445547

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.
@@ -3704,6 +3704,206 @@ export interface ListDataOptions extends RecordActionOptions {
3704
3704
  sort?: 'ascending' | 'descending';
3705
3705
  }
3706
3706
 
3707
+ /**
3708
+ * Defines a node that search clients can use to connect to the search engine.
3709
+ *
3710
+ * @dochash types/records/search
3711
+ * @docname SearchNode
3712
+ */
3713
+ export interface SearchNode {
3714
+ /**
3715
+ * The host of the node.
3716
+ */
3717
+ host: string;
3718
+
3719
+ /**
3720
+ * The port number of the node.
3721
+ */
3722
+ port: number;
3723
+
3724
+ /**
3725
+ * The protocol to use when connecting to the node.
3726
+ */
3727
+ protocol?: 'http' | 'https';
3728
+ }
3729
+
3730
+ /**
3731
+ * Defines a record that represents a collection of documents that can be searched.
3732
+ *
3733
+ * @dochash types/records/search
3734
+ * @docName SearchRecord
3735
+ */
3736
+ export interface SearchRecord extends CrudRecord {
3737
+ /**
3738
+ * The name of the collection that this search record is attached to.
3739
+ */
3740
+ collectionName: string;
3741
+
3742
+ /**
3743
+ * The API key that is used to query the collection.
3744
+ */
3745
+ searchApiKey: string;
3746
+
3747
+ /**
3748
+ * The search nodes that should be used by clients to connect to the search engine.
3749
+ */
3750
+ nodes?: SearchNode[];
3751
+ }
3752
+
3753
+
3754
+ export interface RecordSearchCollectionApiRequest {
3755
+ /**
3756
+ * The name of the record that the package version should be recorded to.
3757
+ */
3758
+ recordName: string;
3759
+
3760
+ /**
3761
+ * The address that the package version should be recorded to.
3762
+ */
3763
+ address: string;
3764
+
3765
+ /**
3766
+ * The schema that should be used for the collection.
3767
+ */
3768
+ schema: SearchCollectionSchema;
3769
+
3770
+ /**
3771
+ * The markers that should be applied to the package version.
3772
+ */
3773
+ markers?: string[];
3774
+ }
3775
+
3776
+
3777
+ /**
3778
+ * Defines a field for a search collection schema.
3779
+ *
3780
+ * @dochash types/records/search
3781
+ * @docname SearchCollectionField
3782
+ */
3783
+ export interface SearchCollectionField {
3784
+ /**
3785
+ * The type of the field.
3786
+ */
3787
+ type:
3788
+ | 'string'
3789
+ | 'string[]'
3790
+ | 'int32'
3791
+ | 'int32[]'
3792
+ | 'int64'
3793
+ | 'int64[]'
3794
+ | 'float'
3795
+ | 'float[]'
3796
+ | 'bool'
3797
+ | 'bool[]'
3798
+ | 'geopoint'
3799
+ | 'geopoint[]'
3800
+ | 'geopolygon'
3801
+ | 'object'
3802
+ | 'object[]'
3803
+ | 'string*'
3804
+ | 'image'
3805
+ | 'auto';
3806
+
3807
+ /**
3808
+ * Enables faceting on the field.
3809
+ *
3810
+ * Defaults to `false`.
3811
+ */
3812
+ facet?: boolean;
3813
+
3814
+ /**
3815
+ * When set to `true`, the field can have empty, null or missing values. Default: `false`.
3816
+ */
3817
+ optional?: boolean;
3818
+
3819
+ /**
3820
+ * When set to `false`, the field will not be indexed in any in-memory index (e.g. search/sort/filter/facet). Default: `true`.
3821
+ */
3822
+ index?: boolean;
3823
+
3824
+ /**
3825
+ * When set to `false`, the field value will not be stored on disk. Default: `true`.
3826
+ */
3827
+ store?: boolean;
3828
+
3829
+ /**
3830
+ * When set to true, the field will be sortable. Default: `true` for numbers, `false` otherwise.
3831
+ */
3832
+ sort?: boolean;
3833
+
3834
+ /**
3835
+ * When set to `true`, the field value can be infix-searched. Incurs significant memory overhead. Default: `false`.
3836
+ */
3837
+ infix?: boolean;
3838
+
3839
+ /**
3840
+ * For configuring language specific tokenization, e.g. `jp` for Japanese. Default: `en` which also broadly supports most European languages.
3841
+ */
3842
+ locale?: string;
3843
+ }
3844
+
3845
+ /**
3846
+ * Defines the schema for a search collection.
3847
+ *
3848
+ * @dochash types/records/search
3849
+ * @docName SearchCollectionSchema
3850
+ */
3851
+ export interface SearchCollectionSchema {
3852
+ /**
3853
+ * The schema that defines the fields in the search collection.
3854
+ */
3855
+ [key: string]: SearchCollectionField;
3856
+ }
3857
+
3858
+ /**
3859
+ * Defines a document that can be stored in a search collection.
3860
+ *
3861
+ * @dochash types/records/search
3862
+ * @docname SearchDocument
3863
+ */
3864
+ export interface SearchDocument {
3865
+ /**
3866
+ * The ID of the document.
3867
+ * If not provided, a new ID will be generated.
3868
+ */
3869
+ id?: string;
3870
+
3871
+ /**
3872
+ * The properties of the document.
3873
+ */
3874
+ [key: string]: any;
3875
+ }
3876
+
3877
+ export type RecordSearchDocumentResult = RecordSearchDocumentSuccess | RecordSearchDocumentFailure;
3878
+
3879
+ export interface RecordSearchDocumentSuccess extends SearchDocument {
3880
+ success: true;
3881
+ }
3882
+
3883
+ export interface RecordSearchDocumentFailure {
3884
+ success: false;
3885
+ errorCode: string;
3886
+ errorMessage: string;
3887
+ }
3888
+
3889
+ export type EraseSearchDocumentResult = EraseSearchDocumentSuccess | EraseSearchDocumentFailure;
3890
+
3891
+ export interface EraseSearchDocumentSuccess extends SearchDocument {
3892
+ success: true;
3893
+ }
3894
+
3895
+ export interface EraseSearchDocumentFailure {
3896
+ success: false;
3897
+ errorCode: string;
3898
+ errorMessage: string;
3899
+ }
3900
+
3901
+ export interface RecordSearchDocumentApiRequest {
3902
+ recordName: string;
3903
+ address: string;
3904
+ document: SearchDocument;
3905
+ }
3906
+
3707
3907
  export type RecordDataResult = RecordDataSuccess | RecordDataFailure;
3708
3908
 
3709
3909
  export interface RecordDataSuccess {
@@ -11310,6 +11510,11 @@ export interface SharedDocument extends SubscriptionLike {
11310
11510
  */
11311
11511
  onEvents: Observable<Action[]>;
11312
11512
 
11513
+ /**
11514
+ * Gets the observable list of updates from the partition.
11515
+ */
11516
+ onUpdates: Observable<string[]>;
11517
+
11313
11518
  /**
11314
11519
  * Gets the observable list of status updates from the partition.
11315
11520
  */
@@ -11371,6 +11576,12 @@ export interface SharedDocument extends SubscriptionLike {
11371
11576
  * @param updates The updates to apply.
11372
11577
  */
11373
11578
  applyStateUpdates(updates: InstUpdate[]): void;
11579
+
11580
+ /**
11581
+ * Applies the given raw updates to the document.
11582
+ * @param updates The updates to apply.
11583
+ */
11584
+ applyUpdates(updates: string[]): void;
11374
11585
  }
11375
11586
 
11376
11587
  export type SharedType = SharedMap | SharedArray | SharedText;
@@ -15208,6 +15419,192 @@ interface Os {
15208
15419
  */
15209
15420
  listInstalledPackages(options?: RecordActionOptions): Promise<ListInstalledPackagesResult>;
15210
15421
 
15422
+ /**
15423
+ * Creates or updates a search collection in the given record.
15424
+ *
15425
+ * Returns a promise that resolves with the result of the operation.
15426
+ *
15427
+ * @param request The request to create or update the search collection.
15428
+ * @param options the options for the request.
15429
+ * @returns A promise that resolves with the result of the operation.
15430
+ *
15431
+ * @example Record a search collection with an automatic schema
15432
+ * const result = await os.recordSearchCollection({
15433
+ * recordName: 'myRecord',
15434
+ * address: 'mySearchCollection',
15435
+ * schema: {
15436
+ * '.*': {
15437
+ * type: 'auto'
15438
+ * }
15439
+ * }
15440
+ * });
15441
+ *
15442
+ * @example Record a search collection with a custom schema
15443
+ * const result = await os.recordSearchCollection({
15444
+ * recordName: 'myRecord',
15445
+ * address: 'mySearchCollection',
15446
+ * schema: {
15447
+ title: {
15448
+ type: 'string',
15449
+ },
15450
+ description: {
15451
+ type: 'string',
15452
+ },
15453
+ price: {
15454
+ type: 'int32',
15455
+ }
15456
+ * }
15457
+ * });
15458
+ *
15459
+ * @dochash actions/os/records
15460
+ * @docgroup 02-search
15461
+ * @docname os.recordSearchCollection
15462
+ */
15463
+ recordSearchCollection(
15464
+ request: RecordSearchCollectionApiRequest,
15465
+ options?: RecordActionOptions
15466
+ ): Promise<CrudRecordItemResult>;
15467
+
15468
+ /**
15469
+ * Deletes a search collection along with all the documents in it.
15470
+ *
15471
+ * Returns a promise that resolves with the result of the operation.
15472
+ *
15473
+ * @param recordName The name of the record to delete the search collection from.
15474
+ * @param address The address of the search collection to delete.
15475
+ * @param options the options for the request.
15476
+ * @returns A promise that resolves with the result of the operation.
15477
+ *
15478
+ * @example Erase a search collection
15479
+ * const result = await os.eraseSearchCollection('recordName', 'mySearchCollection');
15480
+ *
15481
+ * @dochash actions/os/records
15482
+ * @docgroup 02-search
15483
+ * @docname os.eraseSearchCollection
15484
+ */
15485
+ eraseSearchCollection(
15486
+ recordName: string,
15487
+ address: string,
15488
+ options?: RecordActionOptions
15489
+ ): Promise<CrudRecordItemResult>;
15490
+
15491
+ /**
15492
+ * Lists the search collections in a record.
15493
+ *
15494
+ * Returns a promise that resolves with the result of the operation.
15495
+ *
15496
+ * @param recordName The name of the record to delete the search collection from.
15497
+ * @param startingAddress the address that the listing should start after.
15498
+ * @param options the options for the request.
15499
+ * @returns A promise that resolves with the result of the operation.
15500
+ *
15501
+ * @example List search collections
15502
+ * const result = await os.listSearchCollections('recordName', 'mySearchCollection');
15503
+ *
15504
+ * @dochash actions/os/records
15505
+ * @docgroup 02-search
15506
+ * @docname os.listSearchCollections
15507
+ */
15508
+ listSearchCollections(
15509
+ recordName: string,
15510
+ startingAddress?: string,
15511
+ options?: ListDataOptions
15512
+ ): Promise<CrudRecordItemResult>;
15513
+
15514
+ /**
15515
+ * Lists the search collections in a record by a specific marker.
15516
+ * @param recordName The name of the record to list the search collections from.
15517
+ * @param marker The marker to filter the list by.
15518
+ * @param startingAddress The address that the listing should start after.
15519
+ * @param options The options for the request.
15520
+ * @returns A promise that resolves with the result of the operation.
15521
+ *
15522
+ * @example List public read search collections
15523
+ * const result = await os.listSearchCollectionsByMarker('recordName', 'publicRead');
15524
+ *
15525
+ * @example List private search collections
15526
+ * const result = await os.listSearchCollectionsByMarker('recordName', 'private');
15527
+ *
15528
+ * @dochash actions/os/records
15529
+ * @docgroup 02-search
15530
+ * @docname os.listSearchCollectionsByMarker
15531
+ */
15532
+ listSearchCollectionsByMarker(
15533
+ recordName: string,
15534
+ marker: string,
15535
+ startingAddress?: string,
15536
+ options?: ListDataOptions
15537
+ ): Promise<CrudListItemsResult<SearchRecord>>;
15538
+
15539
+ /**
15540
+ * Gets a search collection from the specified record.
15541
+ * @param recordName The name of the record to retrieve the search collection from.
15542
+ * @param address The address of the search collection to retrieve.
15543
+ * @param options The options for the request.
15544
+ * @returns A promise that resolves with the result of the operation.
15545
+ *
15546
+ * @example Get a search collection
15547
+ * const result = await os.getSearchCollection('myRecord', 'mySearchCollection');
15548
+ *
15549
+ * @dochash actions/os/records
15550
+ * @docgroup 02-search
15551
+ * @docname os.getSearchCollection
15552
+ */
15553
+ getSearchCollection(
15554
+ recordName: string,
15555
+ address: string,
15556
+ options?: RecordActionOptions,
15557
+ ): Promise<CrudGetItemResult<SearchRecord>>;
15558
+
15559
+ /**
15560
+ * Records a search document to the specified search collection in the given record.
15561
+ * @param request The request to record the search document.
15562
+ * @param options The options for the request.
15563
+ * @returns A promise that resolves with the result of the operation.
15564
+ *
15565
+ * @example Record a search document
15566
+ * const result = await os.recordSearchDocument({
15567
+ * recordName: 'myRecord',
15568
+ * address: 'mySearchCollection',
15569
+ * document: {
15570
+ * // ensure that the document matches the schema of the search collection
15571
+ * title: 'My Document',
15572
+ * description: 'This is the content of my document.'
15573
+ * price: 10,
15574
+ * }
15575
+ * });
15576
+ *
15577
+ * @dochash actions/os/records
15578
+ * @docgroup 02-search
15579
+ * @docname os.recordSearchDocument
15580
+ */
15581
+ recordSearchDocument(
15582
+ request: RecordSearchDocumentApiRequest,
15583
+ options?: RecordActionOptions
15584
+ ): Promise<RecordSearchDocumentResult>;
15585
+
15586
+ /**
15587
+ * Erases a search document from the specified search collection in the given record.
15588
+ * @param recordName The name of the record that the search document is in.
15589
+ * @param address The address of the search collection that the document is in.
15590
+ * @param documentId The ID of the document that should be erased.
15591
+ * @param options The options for the request.
15592
+ * @returns A promise that resolves with the result of the operation.
15593
+ *
15594
+ * @example Erase a search document
15595
+ * const result = await os.eraseSearchDocument('myRecord', 'mySearchCollection', 'documentId');
15596
+ *
15597
+ * @dochash actions/os/records
15598
+ * @docgroup 02-search
15599
+ * @docname os.eraseSearchDocument
15600
+ */
15601
+ eraseSearchDocument(
15602
+ recordName: string,
15603
+ address: string,
15604
+ documentId: string,
15605
+ options?: RecordActionOptions
15606
+ ): Promise<EraseSearchDocumentResult>;
15607
+
15211
15608
  /**
15212
15609
  * Gets the list of studios that the currently logged in user has access to.
15213
15610
  *
@@ -508,13 +508,10 @@ export class AuxRuntime {
508
508
  }
509
509
  }
510
510
  }
511
- if (isUrl(moduleName)) {
512
- return {
513
- id: moduleName,
514
- url: moduleName,
515
- };
516
- }
517
- return null;
511
+ return {
512
+ id: moduleName,
513
+ url: moduleName,
514
+ };
518
515
  }
519
516
  getShoutTimers() {
520
517
  return {};