@casual-simulation/aux-runtime 3.3.9 → 3.3.11-alpha.11019730384

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.
@@ -10476,6 +10476,296 @@ export interface AISloydGenerateModelOptions {
10476
10476
  }
10477
10477
  }
10478
10478
 
10479
+ /**
10480
+ * Defines an interface for a generic HTTP response.
10481
+ */
10482
+ export interface GenericHttpResponse {
10483
+ /**
10484
+ * The status code for the response.
10485
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
10486
+ *
10487
+ */
10488
+ statusCode: number;
10489
+
10490
+ /**
10491
+ * The list of headers to include in the response.
10492
+ */
10493
+ headers?: GenericHttpHeaders;
10494
+
10495
+ /**
10496
+ * The body of the response.
10497
+ *
10498
+ * If given a string, then the body will be set to that string.
10499
+ * If given an AsyncIterable, then each chunk will be written to the stream as a separate chunk.
10500
+ */
10501
+ body?: string | null | AsyncIterable<string>;
10502
+ }
10503
+
10504
+ export interface GenericHttpHeaders {
10505
+ [key: string]: string;
10506
+ }
10507
+
10508
+ export type KnownErrorCodes =
10509
+ | 'not_logged_in'
10510
+ | 'not_supported'
10511
+ | 'data_not_found'
10512
+ | 'data_too_large'
10513
+ | 'record_not_found'
10514
+ | 'file_not_found'
10515
+ | 'session_not_found'
10516
+ | 'operation_not_found'
10517
+ | 'studio_not_found'
10518
+ | 'user_not_found'
10519
+ | 'inst_not_found'
10520
+ | 'session_already_revoked'
10521
+ | 'invalid_code'
10522
+ | 'invalid_key'
10523
+ | 'invalid_request'
10524
+ | 'invalid_origin'
10525
+ | 'invalid_record_key'
10526
+ | 'session_expired'
10527
+ | 'unacceptable_address'
10528
+ | 'unacceptable_user_id'
10529
+ | 'unacceptable_code'
10530
+ | 'unacceptable_session_key'
10531
+ | 'unacceptable_session_id'
10532
+ | 'unacceptable_request_id'
10533
+ | 'unacceptable_ip_address'
10534
+ | 'unacceptable_address_type'
10535
+ | 'unacceptable_expire_time'
10536
+ | 'unacceptable_request'
10537
+ | 'unacceptable_update'
10538
+ | 'address_type_not_supported'
10539
+ | 'server_error'
10540
+ | 'unauthorized_to_create_record_key'
10541
+ | 'price_does_not_match'
10542
+ | 'user_is_banned'
10543
+ | 'rate_limit_exceeded'
10544
+ | 'not_authorized'
10545
+ | 'not_subscribed'
10546
+ | 'invalid_subscription_tier'
10547
+ | 'subscription_limit_reached'
10548
+ | 'record_already_exists'
10549
+ | 'action_not_supported'
10550
+ | 'no_session_key'
10551
+ | 'unacceptable_studio_id'
10552
+ | 'email_already_exists'
10553
+ | 'parent_email_already_exists'
10554
+ | 'parent_email_required'
10555
+ | 'invalid_room_name'
10556
+ | 'invalid_username'
10557
+ | 'invalid_update_policy'
10558
+ | 'invalid_delete_policy'
10559
+ | 'unacceptable_url'
10560
+ | 'file_already_exists'
10561
+ | 'invalid_file_data'
10562
+ | 'invalid_model'
10563
+ | 'roles_too_large'
10564
+ | 'policy_not_found'
10565
+ | 'policy_too_large'
10566
+ | 'invalid_policy'
10567
+ | 'not_completed'
10568
+ | 'invalid_display_name'
10569
+ | 'permission_already_exists'
10570
+ | 'comId_not_found'
10571
+ | 'comId_already_taken'
10572
+ | 'permission_not_found'
10573
+ | 'unacceptable_connection_token'
10574
+ | 'invalid_token'
10575
+ | 'unacceptable_connection_id'
10576
+ | 'message_not_found'
10577
+ | 'not_found'
10578
+ | 'invalid_connection_state'
10579
+ | 'user_already_exists'
10580
+ | 'session_is_not_revokable'
10581
+ | 'hume_api_error'
10582
+ | 'invalid_webhook_target'
10583
+ | 'took_too_long';
10584
+
10585
+ /**
10586
+ * Defines a base interface for a record that can be stored in a CrudStore.
10587
+ */
10588
+ export interface CrudRecord {
10589
+ /**
10590
+ * The address of the record.
10591
+ */
10592
+ address: string;
10593
+
10594
+ /**
10595
+ * The markers that are associated with the record.
10596
+ */
10597
+ markers: string[];
10598
+ }
10599
+
10600
+ export type CrudRecordItemResult =
10601
+ | CrudRecordItemSuccess
10602
+ | CrudRecordItemFailure;
10603
+
10604
+ export interface CrudRecordItemSuccess {
10605
+ success: true;
10606
+ recordName: string;
10607
+ address: string;
10608
+ }
10609
+
10610
+ export interface CrudRecordItemFailure {
10611
+ success: false;
10612
+ errorCode: KnownErrorCodes;
10613
+ errorMessage: string;
10614
+ }
10615
+
10616
+ export type CrudGetItemResult<T> = CrudGetItemSuccess<T> | CrudGetItemFailure;
10617
+
10618
+ export interface CrudGetItemSuccess<T> {
10619
+ success: true;
10620
+ item: T;
10621
+ }
10622
+
10623
+ export interface CrudGetItemFailure {
10624
+ success: false;
10625
+ errorCode: KnownErrorCodes;
10626
+ errorMessage: string;
10627
+ }
10628
+
10629
+ export type CrudEraseItemResult = CrudEraseItemSuccess | CrudEraseItemFailure;
10630
+
10631
+ export interface CrudEraseItemSuccess {
10632
+ success: true;
10633
+ }
10634
+
10635
+ export interface CrudEraseItemFailure {
10636
+ success: false;
10637
+ errorCode: KnownErrorCodes;
10638
+ errorMessage: string;
10639
+ }
10640
+
10641
+
10642
+ export type CrudListItemsResult<T> =
10643
+ | CrudListItemsSuccess<T>
10644
+ | CrudListItemsFailure;
10645
+
10646
+ export interface CrudListItemsSuccess<T> {
10647
+ success: true;
10648
+ /**
10649
+ * The name of the record that the items are from.
10650
+ */
10651
+ recordName: string;
10652
+
10653
+ /**
10654
+ * The items that were listed.
10655
+ */
10656
+ items: T[];
10657
+
10658
+ /**
10659
+ * The total number of items in the record.
10660
+ */
10661
+ totalCount: number;
10662
+
10663
+ /**
10664
+ * The marker that was listed.
10665
+ * If null, then all markers are listed.
10666
+ */
10667
+ marker?: string;
10668
+ }
10669
+
10670
+ export interface CrudListItemsFailure {
10671
+ success: false;
10672
+ errorCode:
10673
+ | ServerError
10674
+ | NotLoggedInError
10675
+ | NotAuthorizedError
10676
+ | 'data_not_found';
10677
+ errorMessage: string;
10678
+ }
10679
+
10680
+
10681
+ export type HandleWebhookResult = HandleWebhookSuccess | HandleWebhookFailure;
10682
+
10683
+ export interface HandleWebhookSuccess {
10684
+ success: true;
10685
+
10686
+ /**
10687
+ * The result of the webhook.
10688
+ */
10689
+ response: GenericHttpResponse;
10690
+ }
10691
+
10692
+ export interface HandleWebhookFailure {
10693
+ /**
10694
+ * Whether the webhook was successfully handled.
10695
+ */
10696
+ success: false;
10697
+
10698
+ /**
10699
+ * The error code if the webhook was not successfully handled.
10700
+ */
10701
+ errorCode:
10702
+ | ServerError
10703
+ | 'not_found'
10704
+ | NotAuthorizedError
10705
+ | 'invalid_webhook_target';
10706
+
10707
+ /**
10708
+ * The error message if the webhook was not successfully handled.
10709
+ */
10710
+ errorMessage: string;
10711
+ }
10712
+
10713
+
10714
+ /**
10715
+ * Defines an interface that represents the options for a list data action.
10716
+ *
10717
+ * @dochash types/records/data
10718
+ * @docName ListDataOptions
10719
+ */
10720
+ export interface ListWebhooksOptions extends RecordActionOptions {
10721
+ /**
10722
+ * The order that items should be sorted in.
10723
+ * - "ascending" means that the items should be sorted in alphebatically ascending order by address.
10724
+ * - "descending" means that the items should be sorted in alphebatically descending order by address.
10725
+ */
10726
+ sort?: 'ascending' | 'descending';
10727
+ }
10728
+
10729
+
10730
+ export interface WebhookRecord extends CrudRecord {
10731
+ /**
10732
+ * The resource kind of the webhook target.
10733
+ * - 'file': The webhook target is a file record.
10734
+ * - 'inst': The webhook target is an instance record.
10735
+ * - 'data': The webhook target is a data record.
10736
+ */
10737
+ targetResourceKind: 'file' | 'inst' | 'data';
10738
+
10739
+ /**
10740
+ * The name of the record that is being targeted by this webhook.
10741
+ * Null if the webhook is targeting a public inst.
10742
+ */
10743
+ targetRecordName: string | null;
10744
+
10745
+ /**
10746
+ * The address of the record that is being targeted by this webhook.
10747
+ */
10748
+ targetAddress: string;
10749
+
10750
+ // TODO:
10751
+ /**
10752
+ * The calling convention of the webhook.
10753
+ * Different calling conventions support different capabilities.
10754
+ *
10755
+ * - `http`: The webhook is called with a HTTP request. This grants the most flexibility for working with HTTP, and doesn't enforce a strict structure for the request and response.
10756
+ * - `rpc`: The webhook is called with a RPC request. This enforces a strict structure for the request and response.
10757
+ */
10758
+ // callingConvention?: 'http' | 'rpc';
10759
+
10760
+ /**
10761
+ * The ID of the user that represents the webhook.
10762
+ * This is used to authenticate the webhook for access to resources.
10763
+ *
10764
+ * If null, then the webhook does not use any authentication.
10765
+ */
10766
+ userId?: string | null;
10767
+ }
10768
+
10479
10769
 
10480
10770
  interface Ai {
10481
10771
  /**
@@ -12427,6 +12717,141 @@ interface Os {
12427
12717
  */
12428
12718
  eraseManualApprovalData(recordKey: string, address: string, endpoint?: string): Promise<EraseDataResult>;
12429
12719
 
12720
+
12721
+ /**
12722
+ * Creates or updates a [webhook](glossary:webhook-record) in the given record using the given options.
12723
+ *
12724
+ * Returns a promise that resolves with an object that contains whether the operation succeeded.
12725
+ *
12726
+ * @param recordName the name of the record.
12727
+ * @param webhook the webhook that should be created or updated.
12728
+ * @param options the options that should be used.
12729
+ *
12730
+ * @example Create a publically-runnable webhook that runs from an inst.
12731
+ * await os.recordWebhook('myRecord', {
12732
+ * address: 'webhookAddress',
12733
+ * targetResourceKind: 'inst',
12734
+ * targetRecordName: 'myRecord',
12735
+ * targetAddress: 'myInst',
12736
+ * markers: ['publicRead']
12737
+ * });
12738
+ *
12739
+ * @example Create a private webhook that runs from a data record.
12740
+ * await os.recordWebhook('myRecord', {
12741
+ * address: 'webhookAddress',
12742
+ * targetResourceKind: 'data',
12743
+ * targetRecordName: 'myRecord',
12744
+ * targetAddress: 'myDataAddress',
12745
+ * });
12746
+ *
12747
+ * @example Create a private webhook that runs from a file record.
12748
+ * await os.recordWebhook('myRecord', {
12749
+ * address: 'webhookAddress',
12750
+ * targetResourceKind: 'file',
12751
+ * targetRecordName: 'myRecord',
12752
+ * targetAddress: 'myFileName',
12753
+ * });
12754
+ *
12755
+ * @dochash actions/os/records
12756
+ * @docgroup 05-records
12757
+ * @docname os.recordWebhook
12758
+ */
12759
+ recordWebhook(
12760
+ recordName: string,
12761
+ webhook: WebhookRecord,
12762
+ options?: RecordActionOptions
12763
+ ): Promise<CrudRecordItemResult>;
12764
+
12765
+ /**
12766
+ * Runs the webhook in the given record with the provided input.
12767
+ * @param recordName the name of the record.
12768
+ * @param address the address of the webhook.
12769
+ * @param input the input to provide to the webhook.
12770
+ * @param options the options to use.
12771
+ *
12772
+ * @example Run a webhook with some input.
12773
+ * const result = await os.runWebhook('myRecord', 'myWebhookAddress', { myInput: 'myValue' });
12774
+ *
12775
+ * @dochash actions/os/records
12776
+ * @docgroup 05-records
12777
+ * @docname os.runWebhook
12778
+ */
12779
+ runWebhook(recordName: string, address: string, input: any, options?: RecordActionOptions): Promise<HandleWebhookResult>;
12780
+
12781
+ /**
12782
+ * Gets the [webhook](glossary:webhook-record) from the given record.
12783
+ *
12784
+ * Returns a promise that resolves with the webhook data.
12785
+ *
12786
+ * @param recordName the name of the record.
12787
+ * @param address the address of the webhook.
12788
+ * @param options the options to use.
12789
+ *
12790
+ * @dochash actions/os/records
12791
+ * @docgroup 05-records
12792
+ * @docname os.getWebhook
12793
+ */
12794
+ getWebhook(
12795
+ recordName: string,
12796
+ address: string,
12797
+ options?: RecordActionOptions
12798
+ ): Promise<CrudGetItemResult<WebhookRecord>>;
12799
+
12800
+ /**
12801
+ * Deletes the [webhook](glossary:webhook-record) from the given record.
12802
+ * @param recordName the name of the record.
12803
+ * @param address the address of the webhook.
12804
+ * @param options the options to use.
12805
+ *
12806
+ * @dochash actions/os/records
12807
+ * @docgroup 05-records
12808
+ * @docname os.eraseWebhook
12809
+ */
12810
+ eraseWebhook(
12811
+ recordName: string,
12812
+ address: string,
12813
+ options?: RecordActionOptions
12814
+ ): Promise<CrudEraseItemResult>;
12815
+
12816
+ /**
12817
+ * Lists the webhooks that are in the given record.
12818
+ * @param recordName the name of the record.
12819
+ * @param startingAddress the address after which items will be included in the list.
12820
+ * Since items are ordered within the record by address, this can be used as way to iterate through all the webhooks items in a record.
12821
+ * If omitted, then the list will start with the first item.
12822
+ * @param options the options to use.
12823
+ *
12824
+ * @dochash actions/os/records
12825
+ * @docgroup 05-records
12826
+ * @docname os.listWebhooks
12827
+ */
12828
+ listWebhooks(
12829
+ recordName: string,
12830
+ startingAddress?: string,
12831
+ options?: ListWebhooksOptions
12832
+ ): Promise<CrudListItemsResult<WebhookRecord>>;
12833
+
12834
+ /**
12835
+ * Lists the webhooks that are in the given record.
12836
+ * @param recordName the name of the record.
12837
+ * @param marker The marker that needs to be assigned to the data items that should be included in the list.
12838
+ * e.g. Using "publicRead" will return all data items with the "publicRead" marker.
12839
+ * @param startingAddress the address after which items will be included in the list.
12840
+ * Since items are ordered within the record by address, this can be used as way to iterate through all the webhooks items in a record.
12841
+ * If omitted, then the list will start with the first item.
12842
+ * @param options the options to use.
12843
+ *
12844
+ * @dochash actions/os/records
12845
+ * @docgroup 05-records
12846
+ * @docname os.listWebhooksByMarker
12847
+ */
12848
+ listWebhooksByMarker(
12849
+ recordName: string,
12850
+ marker: string,
12851
+ startingAddress?: string,
12852
+ options?: ListWebhooksOptions
12853
+ ): Promise<CrudListItemsResult<WebhookRecord>>;
12854
+
12430
12855
  /**
12431
12856
  * Records the given data as a file.
12432
12857
  * @param recordKey The record that the file should be recorded in.
@@ -1,7 +1,8 @@
1
- import type { AIChatMessage, PublicRecordKeyPolicy, RecordFileFailure } from '@casual-simulation/aux-records';
1
+ import type { AIChatMessage, PublicRecordKeyPolicy, RecordFileFailure, WebhookRecord } from '@casual-simulation/aux-records';
2
+ import type { RecordsClientActions } from '@casual-simulation/aux-records/RecordsClient';
2
3
  import { APPROVED_SYMBOL, AsyncAction, AvailablePermissions } from '@casual-simulation/aux-common';
3
4
  export type RecordsActions = RecordsAsyncActions;
4
- export type RecordsAsyncActions = RecordDataAction | GetRecordDataAction | ListRecordDataAction | ListRecordDataByMarkerAction | EraseRecordDataAction | RecordFileAction | GetFileAction | EraseFileAction | RecordEventAction | GetEventCountAction | AIChatAction | AIChatStreamAction | AIGenerateImageAction | AIGenerateSkyboxAction | AIHumeGetAccessTokenAction | AISloydGenerateModelAction | ListUserStudiosAction | GetPublicRecordKeyAction | GrantRecordPermissionAction | RevokeRecordPermissionAction | GrantInstAdminPermissionAction | GrantRoleAction | RevokeRoleAction | JoinRoomAction | LeaveRoomAction | SetRoomOptionsAction | GetRoomOptionsAction | GetRoomTrackOptionsAction | SetRoomTrackOptionsAction | GetRoomRemoteOptionsAction;
5
+ export type RecordsAsyncActions = RecordDataAction | GetRecordDataAction | ListRecordDataAction | ListRecordDataByMarkerAction | EraseRecordDataAction | RecordFileAction | GetFileAction | EraseFileAction | RecordEventAction | GetEventCountAction | AIChatAction | AIChatStreamAction | AIGenerateImageAction | AIGenerateSkyboxAction | AIHumeGetAccessTokenAction | AISloydGenerateModelAction | ListUserStudiosAction | GetPublicRecordKeyAction | GrantRecordPermissionAction | RevokeRecordPermissionAction | GrantInstAdminPermissionAction | GrantRoleAction | RevokeRoleAction | JoinRoomAction | LeaveRoomAction | SetRoomOptionsAction | GetRoomOptionsAction | GetRoomTrackOptionsAction | SetRoomTrackOptionsAction | GetRoomRemoteOptionsAction | RecordsCallProcedureAction;
5
6
  /**
6
7
  * An event that is used to chat with an AI.
7
8
  */
@@ -423,6 +424,32 @@ export interface EraseRecordDataAction extends DataRecordAction {
423
424
  */
424
425
  address: string;
425
426
  }
427
+ export interface WebhookRecordAction extends RecordsAction {
428
+ }
429
+ /**
430
+ * Defines an event that is able to call a procedure on the records server.
431
+ */
432
+ export interface RecordsCallProcedureAction extends RecordsAction {
433
+ type: 'records_call_procedure';
434
+ /**
435
+ * The procedure to call.
436
+ */
437
+ procedure: Partial<RecordsClientActions>;
438
+ }
439
+ /**
440
+ * Defines an interface that represents the options for a list data action.
441
+ *
442
+ * @dochash types/records/data
443
+ * @docName ListDataOptions
444
+ */
445
+ export interface ListWebhooksOptions extends RecordActionOptions {
446
+ /**
447
+ * The order that items should be sorted in.
448
+ * - "ascending" means that the items should be sorted in alphebatically ascending order by address.
449
+ * - "descending" means that the items should be sorted in alphebatically descending order by address.
450
+ */
451
+ sort?: 'ascending' | 'descending';
452
+ }
426
453
  export interface RecordFileActionOptions extends RecordActionOptions {
427
454
  /**
428
455
  * The markers that should be applied to the record.
@@ -1054,6 +1081,63 @@ export declare function listDataRecordByMarker(recordName: string, marker: strin
1054
1081
  * @param taskId The ID of the task.
1055
1082
  */
1056
1083
  export declare function eraseRecordData(recordKey: string, address: string, requiresApproval: boolean, options: RecordActionOptions, taskId?: number | string): EraseRecordDataAction;
1084
+ /**
1085
+ * Creates a RecordsCallProcedureAction.
1086
+ * @param procedure The procedure to call.
1087
+ * @param options The options.
1088
+ * @param taskId The ID of the async task.
1089
+ */
1090
+ export declare function recordsCallProcedure(procedure: Partial<RecordsClientActions>, options: RecordActionOptions, taskId: number | string): RecordsCallProcedureAction;
1091
+ /**
1092
+ * Creates a RecordWebhookAction.
1093
+ * @param recordName The name of the record.
1094
+ * @param item The item to record.
1095
+ * @param options The options that should be used for the action.
1096
+ * @param taskId The ID of the task.
1097
+ */
1098
+ export declare function recordWebhook(recordName: string, item: WebhookRecord, options: RecordActionOptions, taskId: number | string): RecordsCallProcedureAction;
1099
+ /**
1100
+ * Creates a RunWebhookAction.
1101
+ * @param recordName The name of the record.
1102
+ * @param address The address of the webhook to run.
1103
+ * @param input The input for the webhook.
1104
+ * @param options The options that should be used for the action.
1105
+ * @param taskId The ID of the task.
1106
+ */
1107
+ export declare function runWebhook(recordName: string, address: string, input: any, options: RecordActionOptions, taskId: number | string): RecordsCallProcedureAction;
1108
+ /**
1109
+ * Creates a GetWebhookAction.
1110
+ * @param recordName The name of the record to retrieve.
1111
+ * @param address The address of the data to retrieve.
1112
+ * @param options The options that should be used for the action.
1113
+ * @param taskId The ID of the task.
1114
+ */
1115
+ export declare function getWebhook(recordName: string, address: string, options: RecordActionOptions, taskId?: number | string): RecordsCallProcedureAction;
1116
+ /**
1117
+ * Creates a ListWebhooksAction.
1118
+ * @param recordName The name of the record.
1119
+ * @param startingAddress The address that the list should start with.
1120
+ * @param options The options that should be used for the action.
1121
+ * @param taskId The ID of the task.
1122
+ */
1123
+ export declare function listWebhooks(recordName: string, startingAddress: string, options: ListWebhooksOptions, taskId?: number | string): RecordsCallProcedureAction;
1124
+ /**
1125
+ * Creates a ListWebhooksByMarkerAction.
1126
+ * @param recordName The name of the record.
1127
+ * @param marker The marker.
1128
+ * @param startingAddress The address that the list should start with.
1129
+ * @param options The options that should be used for the action.
1130
+ * @param taskId The ID of the task.
1131
+ */
1132
+ export declare function listWebhooksByMarker(recordName: string, marker: string, startingAddress: string, options: ListWebhooksOptions, taskId?: number | string): RecordsCallProcedureAction;
1133
+ /**
1134
+ * Creates a EraseWebhookAction.
1135
+ * @param recordKey The name of the record.
1136
+ * @param address The address of the data to erase.
1137
+ * @param options The options that should be used for the action.
1138
+ * @param taskId The ID of the task.
1139
+ */
1140
+ export declare function eraseWebhook(recordName: string, address: string, options: RecordActionOptions, taskId?: number | string): RecordsCallProcedureAction;
1057
1141
  /**
1058
1142
  * Creates a RecordFileAction.
1059
1143
  * @param recordKey The key that should be used to access the record.
@@ -305,6 +305,134 @@ export function eraseRecordData(recordKey, address, requiresApproval, options, t
305
305
  taskId,
306
306
  };
307
307
  }
308
+ /**
309
+ * Creates a RecordsCallProcedureAction.
310
+ * @param procedure The procedure to call.
311
+ * @param options The options.
312
+ * @param taskId The ID of the async task.
313
+ */
314
+ export function recordsCallProcedure(procedure, options, taskId) {
315
+ return {
316
+ type: 'records_call_procedure',
317
+ procedure,
318
+ options,
319
+ taskId,
320
+ };
321
+ }
322
+ /**
323
+ * Creates a RecordWebhookAction.
324
+ * @param recordName The name of the record.
325
+ * @param item The item to record.
326
+ * @param options The options that should be used for the action.
327
+ * @param taskId The ID of the task.
328
+ */
329
+ export function recordWebhook(recordName, item, options, taskId) {
330
+ return recordsCallProcedure({
331
+ recordWebhook: {
332
+ input: {
333
+ recordName,
334
+ item: {
335
+ address: item.address,
336
+ targetResourceKind: item.targetResourceKind,
337
+ targetRecordName: item.targetRecordName,
338
+ targetAddress: item.targetAddress,
339
+ markers: item.markers,
340
+ },
341
+ },
342
+ },
343
+ }, options, taskId);
344
+ }
345
+ /**
346
+ * Creates a RunWebhookAction.
347
+ * @param recordName The name of the record.
348
+ * @param address The address of the webhook to run.
349
+ * @param input The input for the webhook.
350
+ * @param options The options that should be used for the action.
351
+ * @param taskId The ID of the task.
352
+ */
353
+ export function runWebhook(recordName, address, input, options, taskId) {
354
+ return recordsCallProcedure({
355
+ runWebhook: {
356
+ query: {
357
+ recordName,
358
+ address,
359
+ },
360
+ input: input,
361
+ },
362
+ }, options, taskId);
363
+ }
364
+ /**
365
+ * Creates a GetWebhookAction.
366
+ * @param recordName The name of the record to retrieve.
367
+ * @param address The address of the data to retrieve.
368
+ * @param options The options that should be used for the action.
369
+ * @param taskId The ID of the task.
370
+ */
371
+ export function getWebhook(recordName, address, options, taskId) {
372
+ return recordsCallProcedure({
373
+ getWebhook: {
374
+ input: {
375
+ recordName,
376
+ address,
377
+ },
378
+ },
379
+ }, options, taskId);
380
+ }
381
+ /**
382
+ * Creates a ListWebhooksAction.
383
+ * @param recordName The name of the record.
384
+ * @param startingAddress The address that the list should start with.
385
+ * @param options The options that should be used for the action.
386
+ * @param taskId The ID of the task.
387
+ */
388
+ export function listWebhooks(recordName, startingAddress, options, taskId) {
389
+ return recordsCallProcedure({
390
+ listWebhooks: {
391
+ input: {
392
+ recordName,
393
+ address: startingAddress,
394
+ sort: options === null || options === void 0 ? void 0 : options.sort,
395
+ },
396
+ },
397
+ }, options, taskId);
398
+ }
399
+ /**
400
+ * Creates a ListWebhooksByMarkerAction.
401
+ * @param recordName The name of the record.
402
+ * @param marker The marker.
403
+ * @param startingAddress The address that the list should start with.
404
+ * @param options The options that should be used for the action.
405
+ * @param taskId The ID of the task.
406
+ */
407
+ export function listWebhooksByMarker(recordName, marker, startingAddress, options, taskId) {
408
+ return recordsCallProcedure({
409
+ listWebhooks: {
410
+ input: {
411
+ recordName,
412
+ address: startingAddress,
413
+ sort: options === null || options === void 0 ? void 0 : options.sort,
414
+ marker: marker,
415
+ },
416
+ },
417
+ }, options, taskId);
418
+ }
419
+ /**
420
+ * Creates a EraseWebhookAction.
421
+ * @param recordKey The name of the record.
422
+ * @param address The address of the data to erase.
423
+ * @param options The options that should be used for the action.
424
+ * @param taskId The ID of the task.
425
+ */
426
+ export function eraseWebhook(recordName, address, options, taskId) {
427
+ return recordsCallProcedure({
428
+ eraseWebhook: {
429
+ input: {
430
+ recordName,
431
+ address,
432
+ },
433
+ },
434
+ }, options, taskId);
435
+ }
308
436
  /**
309
437
  * Creates a RecordFileAction.
310
438
  * @param recordKey The key that should be used to access the record.