@casual-simulation/aux-runtime 3.8.1 → 3.10.2
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/README.md +677 -54
- package/package.json +85 -86
- package/runtime/AuxCompiler.d.ts +11 -2
- package/runtime/AuxCompiler.js +44 -31
- package/runtime/AuxCompiler.js.map +1 -1
- package/runtime/AuxDevice.d.ts +11 -0
- package/runtime/AuxGlobalContext.d.ts +7 -0
- package/runtime/AuxGlobalContext.js +3 -0
- package/runtime/AuxGlobalContext.js.map +1 -1
- package/runtime/AuxLibrary.d.ts +62 -6
- package/runtime/AuxLibrary.js +585 -107
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +2441 -675
- package/runtime/AuxRuntime.js +51 -46
- package/runtime/AuxRuntime.js.map +1 -1
- package/runtime/RecordsEvents.d.ts +294 -2
- package/runtime/RecordsEvents.js +178 -12
- package/runtime/RecordsEvents.js.map +1 -1
- package/runtime/RuntimeBot.js +1 -1
- package/runtime/RuntimeBot.js.map +1 -1
- package/runtime/Transpiler.d.ts +27 -2
- package/runtime/Transpiler.js +117 -20
- package/runtime/Transpiler.js.map +1 -1
- package/runtime/test/TestScriptBotFactory.js +1 -2
- package/runtime/test/TestScriptBotFactory.js.map +1 -1
|
@@ -4,7 +4,7 @@ import type { APPROVED_SYMBOL, AsyncAction, AvailablePermissions, Entitlement, E
|
|
|
4
4
|
import type { CreateRealtimeSessionTokenRequest } from '@casual-simulation/aux-records/AIOpenAIRealtimeInterface';
|
|
5
5
|
import type { PackageRecordVersionKey, PackageRecordVersionKeySpecifier, PackageRecordVersionWithMetadata } from '@casual-simulation/aux-records/packages/version';
|
|
6
6
|
export type RecordsActions = RecordsAsyncActions;
|
|
7
|
-
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 | SubscribeToNotificationAction | GrantEntitlementsAction | RevokeEntitlementGrantAction | RecordPackageVersionAction | InstallPackageAction | ListInstalledPackagesAction;
|
|
7
|
+
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 | SubscribeToNotificationAction | GrantEntitlementsAction | RevokeEntitlementGrantAction | RecordPackageVersionAction | InstallPackageAction | ListInstalledPackagesAction | RecordStoreItemAction | GetStoreItemAction | EraseStoreItemAction | ListStoreItemsAction | ListStoreItemsByMarkerAction | PurchaseStoreItemAction;
|
|
8
8
|
/**
|
|
9
9
|
* An event that is used to chat with an AI.
|
|
10
10
|
*/
|
|
@@ -304,6 +304,18 @@ export interface RecordActionOptions {
|
|
|
304
304
|
*/
|
|
305
305
|
endpoint?: string;
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Defines an interface that represents the options for installing a package.
|
|
309
|
+
*
|
|
310
|
+
* @dochash types/records/extra
|
|
311
|
+
* @docname InstallPackageOptions
|
|
312
|
+
*/
|
|
313
|
+
export interface InstallPackageOptions extends RecordActionOptions {
|
|
314
|
+
/**
|
|
315
|
+
* Whether to downgrade the package if the installed version is newer than the requested version.
|
|
316
|
+
*/
|
|
317
|
+
downgrade?: boolean;
|
|
318
|
+
}
|
|
307
319
|
/**
|
|
308
320
|
* Defines an interface that represents the base for actions that deal with records.
|
|
309
321
|
*/
|
|
@@ -630,7 +642,7 @@ export interface InstallPackageAction extends RecordsAction {
|
|
|
630
642
|
/**
|
|
631
643
|
* The options for the request.
|
|
632
644
|
*/
|
|
633
|
-
options:
|
|
645
|
+
options: InstallPackageOptions;
|
|
634
646
|
}
|
|
635
647
|
export type InstallPackageResult = InstallPackageSuccess | InstallPackageFailure;
|
|
636
648
|
export interface InstallPackageSuccess {
|
|
@@ -751,6 +763,149 @@ export interface RecordPackageVersionAction extends RecordsAction {
|
|
|
751
763
|
export interface ListUserStudiosAction extends RecordsAction {
|
|
752
764
|
type: 'list_user_studios';
|
|
753
765
|
}
|
|
766
|
+
export interface RecordStoreItemAction extends RecordsAction {
|
|
767
|
+
type: 'record_store_item';
|
|
768
|
+
/**
|
|
769
|
+
* The name of the record.
|
|
770
|
+
*/
|
|
771
|
+
recordName: string;
|
|
772
|
+
/**
|
|
773
|
+
* The address of the item.
|
|
774
|
+
*/
|
|
775
|
+
address: string;
|
|
776
|
+
/**
|
|
777
|
+
* The item that should be recorded.
|
|
778
|
+
*/
|
|
779
|
+
item: Omit<StoreItem, 'address'>;
|
|
780
|
+
}
|
|
781
|
+
export interface GetStoreItemAction extends RecordsAction {
|
|
782
|
+
type: 'get_store_item';
|
|
783
|
+
/**
|
|
784
|
+
* The name of the record.
|
|
785
|
+
*/
|
|
786
|
+
recordName: string;
|
|
787
|
+
/**
|
|
788
|
+
* The address of the item.
|
|
789
|
+
*/
|
|
790
|
+
address: string;
|
|
791
|
+
}
|
|
792
|
+
export interface EraseStoreItemAction extends RecordsAction {
|
|
793
|
+
type: 'erase_store_item';
|
|
794
|
+
/**
|
|
795
|
+
* The name of the record.
|
|
796
|
+
*/
|
|
797
|
+
recordName: string;
|
|
798
|
+
/**
|
|
799
|
+
* The address of the item.
|
|
800
|
+
*/
|
|
801
|
+
address: string;
|
|
802
|
+
}
|
|
803
|
+
export interface ListStoreItemsAction extends RecordsAction {
|
|
804
|
+
type: 'list_store_items';
|
|
805
|
+
/**
|
|
806
|
+
* The name of the record.
|
|
807
|
+
*/
|
|
808
|
+
recordName: string;
|
|
809
|
+
/**
|
|
810
|
+
* The address to start listing items after.
|
|
811
|
+
*/
|
|
812
|
+
address: string | null;
|
|
813
|
+
}
|
|
814
|
+
export interface ListStoreItemsByMarkerAction extends Omit<ListStoreItemsAction, 'type'> {
|
|
815
|
+
type: 'list_store_items_by_marker';
|
|
816
|
+
/**
|
|
817
|
+
* The marker that should be used to filter the list.
|
|
818
|
+
*/
|
|
819
|
+
marker: string;
|
|
820
|
+
}
|
|
821
|
+
export interface PurchaseStoreItemAction extends RecordsAction {
|
|
822
|
+
type: 'purchase_store_item';
|
|
823
|
+
/**
|
|
824
|
+
* The name of the record.
|
|
825
|
+
*/
|
|
826
|
+
recordName: string;
|
|
827
|
+
/**
|
|
828
|
+
* The item that should be purchased.
|
|
829
|
+
*/
|
|
830
|
+
item: PurchasableItemReference;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Defines an interface that represents a reference to a store item.
|
|
834
|
+
*
|
|
835
|
+
* @dochash types/records/store
|
|
836
|
+
* @docname PurchasableItemReference
|
|
837
|
+
* @docid PurchasableItemReference
|
|
838
|
+
*/
|
|
839
|
+
export interface PurchasableItemReference {
|
|
840
|
+
/**
|
|
841
|
+
* The address of the item.
|
|
842
|
+
*/
|
|
843
|
+
address: string;
|
|
844
|
+
/**
|
|
845
|
+
* The currency that the item is priced in.
|
|
846
|
+
*/
|
|
847
|
+
currency: string;
|
|
848
|
+
/**
|
|
849
|
+
* The expected cost of the item in the currency's smallest unit (cents, etc.).
|
|
850
|
+
*/
|
|
851
|
+
cost: number;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Defines an interface that represents a store item.
|
|
855
|
+
* That is, an item that can be purchased by a user to grant them a role.
|
|
856
|
+
*
|
|
857
|
+
* @dochash types/records/store
|
|
858
|
+
* @doctitle Store Types
|
|
859
|
+
* @docdescription Types that are used for store actions.
|
|
860
|
+
* @docsidebar Store
|
|
861
|
+
* @docname StoreItem
|
|
862
|
+
* @docid StoreItem
|
|
863
|
+
*/
|
|
864
|
+
export interface StoreItem {
|
|
865
|
+
/**
|
|
866
|
+
* The markers that are associated with the item.
|
|
867
|
+
*/
|
|
868
|
+
markers: string[];
|
|
869
|
+
/**
|
|
870
|
+
* The name of the item.
|
|
871
|
+
*/
|
|
872
|
+
name: string;
|
|
873
|
+
/**
|
|
874
|
+
* The description of the item.
|
|
875
|
+
*/
|
|
876
|
+
description: string;
|
|
877
|
+
/**
|
|
878
|
+
* The list of image URLs that represent the item.
|
|
879
|
+
*/
|
|
880
|
+
imageUrls: string[];
|
|
881
|
+
/**
|
|
882
|
+
* The [3-letter ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) that the item is priced in.
|
|
883
|
+
*
|
|
884
|
+
* See https://www.iso.org/iso-4217-currency-codes.html
|
|
885
|
+
*/
|
|
886
|
+
currency: string;
|
|
887
|
+
/**
|
|
888
|
+
* The cost of the item in the currency's smallest unit. (e.g. cents, pence, etc.)
|
|
889
|
+
* Must be an interger.
|
|
890
|
+
*/
|
|
891
|
+
cost: number;
|
|
892
|
+
/**
|
|
893
|
+
* The [tax code](https://docs.stripe.com/tax/tax-codes) for the item.
|
|
894
|
+
* Currently only stripe tax codes are supported.
|
|
895
|
+
*
|
|
896
|
+
* See https://docs.stripe.com/tax/tax-codes
|
|
897
|
+
*/
|
|
898
|
+
taxCode?: string | null;
|
|
899
|
+
/**
|
|
900
|
+
* The name of the role that the item grants.
|
|
901
|
+
*/
|
|
902
|
+
roleName: string;
|
|
903
|
+
/**
|
|
904
|
+
* The amount of time in miliseconds that the role is granted for after purchase.
|
|
905
|
+
* If null, then the role is granted forever.
|
|
906
|
+
*/
|
|
907
|
+
roleGrantTimeMs: number | null;
|
|
908
|
+
}
|
|
754
909
|
/**
|
|
755
910
|
* Defines an interface that represents an action that requests a key to a public record.
|
|
756
911
|
*/
|
|
@@ -1120,6 +1275,83 @@ export interface RoomRemoteOptions {
|
|
|
1120
1275
|
*/
|
|
1121
1276
|
audioLevel: number;
|
|
1122
1277
|
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Defines an interface that represents a reference to a store item.
|
|
1280
|
+
*
|
|
1281
|
+
* @dochash types/records/store
|
|
1282
|
+
* @docname PurchasableItemReference
|
|
1283
|
+
* @docid PurchasableItemReference
|
|
1284
|
+
*/
|
|
1285
|
+
export interface PurchasableItemReference {
|
|
1286
|
+
/**
|
|
1287
|
+
* The address of the item.
|
|
1288
|
+
*/
|
|
1289
|
+
address: string;
|
|
1290
|
+
/**
|
|
1291
|
+
* The currency that the item is priced in.
|
|
1292
|
+
*/
|
|
1293
|
+
currency: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* The expected cost of the item in the currency's smallest unit (cents, etc.).
|
|
1296
|
+
*/
|
|
1297
|
+
cost: number;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Defines an interface that represents a store item.
|
|
1301
|
+
* That is, an item that can be purchased by a user to grant them a role.
|
|
1302
|
+
*
|
|
1303
|
+
* @dochash types/records/store
|
|
1304
|
+
* @doctitle Store Types
|
|
1305
|
+
* @docdescription Types that are used for store actions.
|
|
1306
|
+
* @docsidebar Store
|
|
1307
|
+
* @docname StoreItem
|
|
1308
|
+
* @docid StoreItem
|
|
1309
|
+
*/
|
|
1310
|
+
export interface StoreItem {
|
|
1311
|
+
/**
|
|
1312
|
+
* The markers that are associated with the item.
|
|
1313
|
+
*/
|
|
1314
|
+
markers: string[];
|
|
1315
|
+
/**
|
|
1316
|
+
* The name of the item.
|
|
1317
|
+
*/
|
|
1318
|
+
name: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* The description of the item.
|
|
1321
|
+
*/
|
|
1322
|
+
description: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* The list of image URLs that represent the item.
|
|
1325
|
+
*/
|
|
1326
|
+
imageUrls: string[];
|
|
1327
|
+
/**
|
|
1328
|
+
* The [3-letter ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) that the item is priced in.
|
|
1329
|
+
*
|
|
1330
|
+
* See https://www.iso.org/iso-4217-currency-codes.html
|
|
1331
|
+
*/
|
|
1332
|
+
currency: string;
|
|
1333
|
+
/**
|
|
1334
|
+
* The cost of the item in the currency's smallest unit. (e.g. cents, pence, etc.)
|
|
1335
|
+
* Must be an interger.
|
|
1336
|
+
*/
|
|
1337
|
+
cost: number;
|
|
1338
|
+
/**
|
|
1339
|
+
* The [tax code](https://docs.stripe.com/tax/tax-codes) for the item.
|
|
1340
|
+
* Currently only stripe tax codes are supported.
|
|
1341
|
+
*
|
|
1342
|
+
* See https://docs.stripe.com/tax/tax-codes
|
|
1343
|
+
*/
|
|
1344
|
+
taxCode?: string | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* The name of the role that the item grants.
|
|
1347
|
+
*/
|
|
1348
|
+
roleName: string;
|
|
1349
|
+
/**
|
|
1350
|
+
* The amount of time in miliseconds that the role is granted for after purchase.
|
|
1351
|
+
* If null, then the role is granted forever.
|
|
1352
|
+
*/
|
|
1353
|
+
roleGrantTimeMs: number | null;
|
|
1354
|
+
}
|
|
1123
1355
|
/**
|
|
1124
1356
|
* Creates a new AIChatAction.
|
|
1125
1357
|
*
|
|
@@ -1459,6 +1691,16 @@ export declare function listNotificationSubscriptions(recordName: string, addres
|
|
|
1459
1691
|
* @param taskId The ID of the task.
|
|
1460
1692
|
*/
|
|
1461
1693
|
export declare function listUserNotificationSubscriptions(options: RecordActionOptions, taskId?: number | string): RecordsCallProcedureAction;
|
|
1694
|
+
export interface xpUserIdQuery {
|
|
1695
|
+
/** The auth user Id of the xp user. */
|
|
1696
|
+
userId?: string;
|
|
1697
|
+
/** The xp user Id of the xp user. */
|
|
1698
|
+
xpId?: string;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Possible statuses for an xp contract.
|
|
1702
|
+
*/
|
|
1703
|
+
export type xpContractStatus = 'open' | 'draft' | 'closed';
|
|
1462
1704
|
/**
|
|
1463
1705
|
* Creates a RecordFileAction.
|
|
1464
1706
|
* @param recordKey The key that should be used to access the record.
|
|
@@ -1540,6 +1782,56 @@ export declare function listUserStudios(options: RecordActionOptions, taskId?: n
|
|
|
1540
1782
|
* @param taskId The ID of the task.
|
|
1541
1783
|
*/
|
|
1542
1784
|
export declare function listStudioRecords(studioId: string, options: RecordActionOptions, taskId?: number | string): RecordsCallProcedureAction;
|
|
1785
|
+
/**
|
|
1786
|
+
* Creates a RecordStoreItemAction.
|
|
1787
|
+
* @param recordName The name of the record.
|
|
1788
|
+
* @param address The address of the item in the record.
|
|
1789
|
+
* @param item The item.
|
|
1790
|
+
* @param options The options.
|
|
1791
|
+
* @param taskId The ID of the task.
|
|
1792
|
+
*/
|
|
1793
|
+
export declare function recordStoreItem(recordName: string, address: string, item: StoreItem, options: RecordActionOptions, taskId?: number | string): RecordStoreItemAction;
|
|
1794
|
+
/**
|
|
1795
|
+
* Creates a GetStoreItemAction.
|
|
1796
|
+
* @param recordName The name of the record.
|
|
1797
|
+
* @param address The address of the item in the record.
|
|
1798
|
+
* @param options The options.
|
|
1799
|
+
* @param taskId The ID of the task.
|
|
1800
|
+
*/
|
|
1801
|
+
export declare function getStoreItem(recordName: string, address: string, options: RecordActionOptions, taskId?: number | string): GetStoreItemAction;
|
|
1802
|
+
/**
|
|
1803
|
+
* Creates a EraseStoreItemAction.
|
|
1804
|
+
* @param recordName The name of the record.
|
|
1805
|
+
* @param address The address of the item in the record.
|
|
1806
|
+
* @param options The options.
|
|
1807
|
+
* @param taskId The ID of the task.
|
|
1808
|
+
*/
|
|
1809
|
+
export declare function eraseStoreItem(recordName: string, address: string, options: RecordActionOptions, taskId?: number | string): EraseStoreItemAction;
|
|
1810
|
+
/**
|
|
1811
|
+
* Creates a EraseStoreItemAction.
|
|
1812
|
+
* @param recordName The name of the record.
|
|
1813
|
+
* @param address The address to start listing items after.
|
|
1814
|
+
* @param options The options.
|
|
1815
|
+
* @param taskId The ID of the task.
|
|
1816
|
+
*/
|
|
1817
|
+
export declare function listStoreItems(recordName: string, address: string | null, options: RecordActionOptions, taskId?: number | string): ListStoreItemsAction;
|
|
1818
|
+
/**
|
|
1819
|
+
* Creates a ListStoreItemsByMarkerAction.
|
|
1820
|
+
* @param recordName The name of the record.
|
|
1821
|
+
* @param marker The marker to filter by.
|
|
1822
|
+
* @param address The address to start listing items after.
|
|
1823
|
+
* @param options The options.
|
|
1824
|
+
* @param taskId The ID of the task.
|
|
1825
|
+
*/
|
|
1826
|
+
export declare function listStoreItemsByMarker(recordName: string, marker: string, address: string | null, options: RecordActionOptions, taskId?: number | string): ListStoreItemsByMarkerAction;
|
|
1827
|
+
/**
|
|
1828
|
+
* Creates a PurchaseStoreItemAction.
|
|
1829
|
+
* @param recordName The name of the record.
|
|
1830
|
+
* @param item The item to purchase.
|
|
1831
|
+
* @param options The options to use.
|
|
1832
|
+
* @param taskId The ID of the task.
|
|
1833
|
+
*/
|
|
1834
|
+
export declare function purchaseStoreItem(recordName: string, item: PurchasableItemReference, options: RecordActionOptions, taskId?: number | string): PurchaseStoreItemAction;
|
|
1543
1835
|
/**
|
|
1544
1836
|
* Creates a new JoinRoomAction.
|
|
1545
1837
|
* @param roomName The name of the room.
|
package/runtime/RecordsEvents.js
CHANGED
|
@@ -9,7 +9,7 @@ export function aiChat(messages, options, taskId) {
|
|
|
9
9
|
return {
|
|
10
10
|
type: 'ai_chat',
|
|
11
11
|
messages,
|
|
12
|
-
options: options
|
|
12
|
+
options: options ?? {},
|
|
13
13
|
taskId,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -24,7 +24,7 @@ export function aiChatStream(messages, options, taskId) {
|
|
|
24
24
|
return {
|
|
25
25
|
type: 'ai_chat_stream',
|
|
26
26
|
messages,
|
|
27
|
-
options: options
|
|
27
|
+
options: options ?? {},
|
|
28
28
|
taskId,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -39,7 +39,7 @@ export function aiListChatModels(options, taskId) {
|
|
|
39
39
|
aiListChatModels: {
|
|
40
40
|
input: {},
|
|
41
41
|
},
|
|
42
|
-
}, options
|
|
42
|
+
}, options ?? {}, taskId);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Creates a new AIGenerateSkyboxAction.
|
|
@@ -53,7 +53,7 @@ export function aiGenerateSkybox(prompt, negativePrompt, options, taskId) {
|
|
|
53
53
|
type: 'ai_generate_skybox',
|
|
54
54
|
prompt,
|
|
55
55
|
negativePrompt,
|
|
56
|
-
options: options
|
|
56
|
+
options: options ?? {},
|
|
57
57
|
taskId,
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -66,7 +66,7 @@ export function aiGenerateImage(parameters, options, taskId) {
|
|
|
66
66
|
return {
|
|
67
67
|
type: 'ai_generate_image',
|
|
68
68
|
...parameters,
|
|
69
|
-
options: options
|
|
69
|
+
options: options ?? {},
|
|
70
70
|
taskId,
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -79,7 +79,7 @@ export function aiHumeGetAccessToken(recordName, options, taskId) {
|
|
|
79
79
|
return {
|
|
80
80
|
type: 'ai_hume_get_access_token',
|
|
81
81
|
recordName,
|
|
82
|
-
options: options
|
|
82
|
+
options: options ?? {},
|
|
83
83
|
taskId,
|
|
84
84
|
};
|
|
85
85
|
}
|
|
@@ -451,7 +451,7 @@ export function listWebhooks(recordName, startingAddress, options, taskId) {
|
|
|
451
451
|
input: {
|
|
452
452
|
recordName,
|
|
453
453
|
address: startingAddress,
|
|
454
|
-
sort: options
|
|
454
|
+
sort: options?.sort,
|
|
455
455
|
},
|
|
456
456
|
},
|
|
457
457
|
}, options, taskId);
|
|
@@ -470,7 +470,7 @@ export function listWebhooksByMarker(recordName, marker, startingAddress, option
|
|
|
470
470
|
input: {
|
|
471
471
|
recordName,
|
|
472
472
|
address: startingAddress,
|
|
473
|
-
sort: options
|
|
473
|
+
sort: options?.sort,
|
|
474
474
|
marker: marker,
|
|
475
475
|
},
|
|
476
476
|
},
|
|
@@ -594,7 +594,7 @@ export function listNotificationsByMarker(recordName, marker, startingAddress, o
|
|
|
594
594
|
recordName,
|
|
595
595
|
marker,
|
|
596
596
|
address: startingAddress,
|
|
597
|
-
sort: options
|
|
597
|
+
sort: options?.sort,
|
|
598
598
|
},
|
|
599
599
|
},
|
|
600
600
|
}, options, taskId);
|
|
@@ -631,7 +631,7 @@ export function sendNotification(recordName, address, payload, options, taskId)
|
|
|
631
631
|
recordName,
|
|
632
632
|
address,
|
|
633
633
|
payload,
|
|
634
|
-
topic: options
|
|
634
|
+
topic: options?.topic,
|
|
635
635
|
},
|
|
636
636
|
},
|
|
637
637
|
}, options, taskId);
|
|
@@ -666,6 +666,72 @@ export function listUserNotificationSubscriptions(options, taskId) {
|
|
|
666
666
|
},
|
|
667
667
|
}, options, taskId);
|
|
668
668
|
}
|
|
669
|
+
// /**
|
|
670
|
+
// * Creates an action that can be used to provide meta data on an auth users Xp (user) identity.
|
|
671
|
+
// */
|
|
672
|
+
// export function getXpUserMeta(
|
|
673
|
+
// by: xpUserIdQuery | string | undefined,
|
|
674
|
+
// options: RecordActionOptions,
|
|
675
|
+
// taskId: string | number
|
|
676
|
+
// ): RecordsCallProcedureAction {
|
|
677
|
+
// if (typeof by === 'string') by = { userId: by };
|
|
678
|
+
// if (!by) by = {};
|
|
679
|
+
// return recordsCallProcedure(
|
|
680
|
+
// {
|
|
681
|
+
// getXpUserMeta: {
|
|
682
|
+
// input: {
|
|
683
|
+
// ...by,
|
|
684
|
+
// },
|
|
685
|
+
// },
|
|
686
|
+
// },
|
|
687
|
+
// options,
|
|
688
|
+
// taskId
|
|
689
|
+
// );
|
|
690
|
+
// }
|
|
691
|
+
// /**
|
|
692
|
+
// * Creates an action that can be used to create a contract between two xp users.
|
|
693
|
+
// */
|
|
694
|
+
// export function createXpContract(
|
|
695
|
+
// contractMeta: {
|
|
696
|
+
// forUser: xpUserIdQuery | string | null;
|
|
697
|
+
// gigRate: number;
|
|
698
|
+
// gigs: number;
|
|
699
|
+
// status: Exclude<xpContractStatus, 'closed'>;
|
|
700
|
+
// description?: string;
|
|
701
|
+
// accountCurrency?: string;
|
|
702
|
+
// },
|
|
703
|
+
// options: RecordActionOptions,
|
|
704
|
+
// taskId: string | number
|
|
705
|
+
// ): RecordsCallProcedureAction {
|
|
706
|
+
// if (typeof contractMeta.forUser === 'string')
|
|
707
|
+
// contractMeta.forUser = { userId: contractMeta.forUser };
|
|
708
|
+
// return recordsCallProcedure(
|
|
709
|
+
// {
|
|
710
|
+
// createXpContract: {
|
|
711
|
+
// input: {
|
|
712
|
+
// contract: {
|
|
713
|
+
// contractedUserId: contractMeta.forUser,
|
|
714
|
+
// gigRate: contractMeta.gigRate,
|
|
715
|
+
// gigs: contractMeta.gigs,
|
|
716
|
+
// status: contractMeta.status,
|
|
717
|
+
// description: contractMeta.description,
|
|
718
|
+
// accountCurrency: contractMeta.accountCurrency,
|
|
719
|
+
// },
|
|
720
|
+
// },
|
|
721
|
+
// },
|
|
722
|
+
// },
|
|
723
|
+
// options,
|
|
724
|
+
// taskId
|
|
725
|
+
// );
|
|
726
|
+
// }
|
|
727
|
+
// TODO: Implement this
|
|
728
|
+
// export function issueDraftXpContractToUser(config: {
|
|
729
|
+
// draftContractId: string;
|
|
730
|
+
// receivingUserId: string;
|
|
731
|
+
// }): RecordsCallProcedureAction {
|
|
732
|
+
// return recordsCallProcedure({
|
|
733
|
+
// });
|
|
734
|
+
// }
|
|
669
735
|
/**
|
|
670
736
|
* Creates a RecordFileAction.
|
|
671
737
|
* @param recordKey The key that should be used to access the record.
|
|
@@ -857,7 +923,7 @@ export function listPackageContainers(recordName, address, options, taskId) {
|
|
|
857
923
|
input: {
|
|
858
924
|
recordName,
|
|
859
925
|
address,
|
|
860
|
-
sort: options
|
|
926
|
+
sort: options?.sort,
|
|
861
927
|
},
|
|
862
928
|
},
|
|
863
929
|
}, options, taskId);
|
|
@@ -868,7 +934,7 @@ export function listPackageContainersByMarker(recordName, marker, address, optio
|
|
|
868
934
|
input: {
|
|
869
935
|
recordName,
|
|
870
936
|
address,
|
|
871
|
-
sort: options
|
|
937
|
+
sort: options?.sort,
|
|
872
938
|
marker,
|
|
873
939
|
},
|
|
874
940
|
},
|
|
@@ -928,6 +994,106 @@ export function listStudioRecords(studioId, options, taskId) {
|
|
|
928
994
|
},
|
|
929
995
|
}, options, taskId);
|
|
930
996
|
}
|
|
997
|
+
/**
|
|
998
|
+
* Creates a RecordStoreItemAction.
|
|
999
|
+
* @param recordName The name of the record.
|
|
1000
|
+
* @param address The address of the item in the record.
|
|
1001
|
+
* @param item The item.
|
|
1002
|
+
* @param options The options.
|
|
1003
|
+
* @param taskId The ID of the task.
|
|
1004
|
+
*/
|
|
1005
|
+
export function recordStoreItem(recordName, address, item, options, taskId) {
|
|
1006
|
+
return {
|
|
1007
|
+
type: 'record_store_item',
|
|
1008
|
+
recordName,
|
|
1009
|
+
address,
|
|
1010
|
+
item,
|
|
1011
|
+
options,
|
|
1012
|
+
taskId,
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Creates a GetStoreItemAction.
|
|
1017
|
+
* @param recordName The name of the record.
|
|
1018
|
+
* @param address The address of the item in the record.
|
|
1019
|
+
* @param options The options.
|
|
1020
|
+
* @param taskId The ID of the task.
|
|
1021
|
+
*/
|
|
1022
|
+
export function getStoreItem(recordName, address, options, taskId) {
|
|
1023
|
+
return {
|
|
1024
|
+
type: 'get_store_item',
|
|
1025
|
+
recordName,
|
|
1026
|
+
address,
|
|
1027
|
+
options,
|
|
1028
|
+
taskId,
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Creates a EraseStoreItemAction.
|
|
1033
|
+
* @param recordName The name of the record.
|
|
1034
|
+
* @param address The address of the item in the record.
|
|
1035
|
+
* @param options The options.
|
|
1036
|
+
* @param taskId The ID of the task.
|
|
1037
|
+
*/
|
|
1038
|
+
export function eraseStoreItem(recordName, address, options, taskId) {
|
|
1039
|
+
return {
|
|
1040
|
+
type: 'erase_store_item',
|
|
1041
|
+
recordName,
|
|
1042
|
+
address,
|
|
1043
|
+
options,
|
|
1044
|
+
taskId,
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Creates a EraseStoreItemAction.
|
|
1049
|
+
* @param recordName The name of the record.
|
|
1050
|
+
* @param address The address to start listing items after.
|
|
1051
|
+
* @param options The options.
|
|
1052
|
+
* @param taskId The ID of the task.
|
|
1053
|
+
*/
|
|
1054
|
+
export function listStoreItems(recordName, address, options, taskId) {
|
|
1055
|
+
return {
|
|
1056
|
+
type: 'list_store_items',
|
|
1057
|
+
recordName,
|
|
1058
|
+
address,
|
|
1059
|
+
options,
|
|
1060
|
+
taskId,
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Creates a ListStoreItemsByMarkerAction.
|
|
1065
|
+
* @param recordName The name of the record.
|
|
1066
|
+
* @param marker The marker to filter by.
|
|
1067
|
+
* @param address The address to start listing items after.
|
|
1068
|
+
* @param options The options.
|
|
1069
|
+
* @param taskId The ID of the task.
|
|
1070
|
+
*/
|
|
1071
|
+
export function listStoreItemsByMarker(recordName, marker, address, options, taskId) {
|
|
1072
|
+
return {
|
|
1073
|
+
type: 'list_store_items_by_marker',
|
|
1074
|
+
recordName,
|
|
1075
|
+
address,
|
|
1076
|
+
marker,
|
|
1077
|
+
options,
|
|
1078
|
+
taskId,
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Creates a PurchaseStoreItemAction.
|
|
1083
|
+
* @param recordName The name of the record.
|
|
1084
|
+
* @param item The item to purchase.
|
|
1085
|
+
* @param options The options to use.
|
|
1086
|
+
* @param taskId The ID of the task.
|
|
1087
|
+
*/
|
|
1088
|
+
export function purchaseStoreItem(recordName, item, options, taskId) {
|
|
1089
|
+
return {
|
|
1090
|
+
type: 'purchase_store_item',
|
|
1091
|
+
recordName,
|
|
1092
|
+
item,
|
|
1093
|
+
options,
|
|
1094
|
+
taskId,
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
931
1097
|
/**
|
|
932
1098
|
* Creates a new JoinRoomAction.
|
|
933
1099
|
* @param roomName The name of the room.
|