@casual-simulation/aux-common 2.0.19-alpha.1523438944 → 2.0.22
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/bots/Bot.d.ts +14 -0
- package/bots/Bot.js +0 -19
- package/bots/Bot.js.map +1 -1
- package/bots/BotEvents.d.ts +105 -130
- package/bots/BotEvents.js +43 -34
- package/bots/BotEvents.js.map +1 -1
- package/package.json +7 -6
- package/runtime/AuxLibrary.d.ts +75 -21
- package/runtime/AuxLibrary.js +97 -178
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +297 -144
- package/runtime/AuxRuntime.js +2 -8
- package/runtime/AuxRuntime.js.map +1 -1
- package/runtime/BlobPolyfill.js +34 -0
- package/runtime/BlobPolyfill.js.map +1 -1
- package/runtime/RuntimeBot.js +16 -1
- package/runtime/RuntimeBot.js.map +1 -1
- package/test/YjsTestHelpers.js.map +1 -1
- package/yjs/YjsHelpers.d.ts +1 -1
|
@@ -2238,96 +2238,26 @@ declare interface UnsuccessfulGeolocation {
|
|
|
2238
2238
|
*/
|
|
2239
2239
|
declare type GeoLocation = SuccessfulGeolocation | UnsuccessfulGeolocation;
|
|
2240
2240
|
|
|
2241
|
-
|
|
2242
2241
|
/**
|
|
2243
|
-
* Defines an
|
|
2242
|
+
* Defines an interface that represents options for converting a geolocation to a what3words address.
|
|
2244
2243
|
*/
|
|
2245
|
-
|
|
2246
|
-
type: 'publish_record';
|
|
2247
|
-
|
|
2244
|
+
export interface ConvertGeolocationToWhat3WordsOptions {
|
|
2248
2245
|
/**
|
|
2249
|
-
* The
|
|
2246
|
+
* The latitude to convert.
|
|
2250
2247
|
*/
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
/**
|
|
2254
|
-
* The address that the record should be published to.
|
|
2255
|
-
*/
|
|
2256
|
-
address: string;
|
|
2248
|
+
latitude: number;
|
|
2257
2249
|
|
|
2258
2250
|
/**
|
|
2259
|
-
* The
|
|
2251
|
+
* The longitude to convert.
|
|
2260
2252
|
*/
|
|
2261
|
-
|
|
2253
|
+
longitude: number;
|
|
2262
2254
|
|
|
2263
2255
|
/**
|
|
2264
|
-
* The
|
|
2256
|
+
* The identifier of the language that should be used for the resulting what3words address.
|
|
2265
2257
|
*/
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
uncopiable: true;
|
|
2258
|
+
language?: string;
|
|
2269
2259
|
}
|
|
2270
2260
|
|
|
2271
|
-
export interface RecordDefinition {
|
|
2272
|
-
/**
|
|
2273
|
-
* The auth token that should be used to authenticate the publish record request.
|
|
2274
|
-
* Different auth tokens can be used to publish records to different CasualOS.me accounts.
|
|
2275
|
-
* Defaults to using the auth token in the auth bot.
|
|
2276
|
-
*/
|
|
2277
|
-
authToken?: string;
|
|
2278
|
-
|
|
2279
|
-
/**
|
|
2280
|
-
* The space that the record should be published in.
|
|
2281
|
-
* Defaults to tempRestricted.
|
|
2282
|
-
*/
|
|
2283
|
-
space?: RecordSpace;
|
|
2284
|
-
|
|
2285
|
-
/**
|
|
2286
|
-
* The record that should be published.
|
|
2287
|
-
*/
|
|
2288
|
-
record: any;
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
export interface AddressedRecord extends RecordDefinition {
|
|
2292
|
-
/**
|
|
2293
|
-
* The address that the record should be published to.
|
|
2294
|
-
*/
|
|
2295
|
-
address: string;
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
export interface PrefixedRecord extends RecordDefinition {
|
|
2299
|
-
/**
|
|
2300
|
-
* The prefix that the record should be published with.
|
|
2301
|
-
*/
|
|
2302
|
-
prefix?: string;
|
|
2303
|
-
|
|
2304
|
-
/**
|
|
2305
|
-
* The ID that the record should be published with.
|
|
2306
|
-
* Defaults to a UUID.
|
|
2307
|
-
*/
|
|
2308
|
-
id?: string;
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
export type PublishableRecord = AddressedRecord | PrefixedRecord;
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
export interface DeletableRecord {
|
|
2315
|
-
/**
|
|
2316
|
-
* The auth token that should be used to authenticate the delete record request.
|
|
2317
|
-
*/
|
|
2318
|
-
authToken?: string;
|
|
2319
|
-
|
|
2320
|
-
/**
|
|
2321
|
-
* The space that the record lives in.
|
|
2322
|
-
*/
|
|
2323
|
-
space: RecordSpace;
|
|
2324
|
-
|
|
2325
|
-
/**
|
|
2326
|
-
* The address that the record was published to.
|
|
2327
|
-
*/
|
|
2328
|
-
address: string;
|
|
2329
|
-
};
|
|
2330
|
-
|
|
2331
2261
|
/**
|
|
2332
2262
|
* Defines an interface for options that show a payment box.
|
|
2333
2263
|
*/
|
|
@@ -2472,6 +2402,10 @@ declare interface ParsedBotLink {
|
|
|
2472
2402
|
botIDs: string[];
|
|
2473
2403
|
}
|
|
2474
2404
|
|
|
2405
|
+
declare interface BotVars {
|
|
2406
|
+
[variable: string]: any;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2475
2409
|
/**
|
|
2476
2410
|
* Defines an interface that represents the bot links a bot can have.
|
|
2477
2411
|
*/
|
|
@@ -2513,6 +2447,11 @@ export interface Bot {
|
|
|
2513
2447
|
*/
|
|
2514
2448
|
links: BotLinks;
|
|
2515
2449
|
|
|
2450
|
+
/**
|
|
2451
|
+
* THe variables that are stored in this bot.
|
|
2452
|
+
*/
|
|
2453
|
+
vars: BotVars;
|
|
2454
|
+
|
|
2516
2455
|
/**
|
|
2517
2456
|
* The raw tag values that the bot contains.
|
|
2518
2457
|
* If you want to access the script code for a formula, use this.
|
|
@@ -2892,6 +2831,170 @@ export interface DebuggerOptions {
|
|
|
2892
2831
|
configBot: Bot | BotTags;
|
|
2893
2832
|
}
|
|
2894
2833
|
|
|
2834
|
+
|
|
2835
|
+
/**
|
|
2836
|
+
* Defines an interface that represents the result of a "create public record key" operation.
|
|
2837
|
+
*/
|
|
2838
|
+
export type CreatePublicRecordKeyResult =
|
|
2839
|
+
| CreatePublicRecordKeySuccess
|
|
2840
|
+
| CreatePublicRecordKeyFailure;
|
|
2841
|
+
|
|
2842
|
+
/**
|
|
2843
|
+
* Defines an interface that represents a successful "create public record key" result.
|
|
2844
|
+
*/
|
|
2845
|
+
export interface CreatePublicRecordKeySuccess {
|
|
2846
|
+
/**
|
|
2847
|
+
* Whether the operation was successful.
|
|
2848
|
+
*/
|
|
2849
|
+
success: true;
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* The key that was created.
|
|
2853
|
+
*/
|
|
2854
|
+
recordKey: string;
|
|
2855
|
+
|
|
2856
|
+
/**
|
|
2857
|
+
* The name of the record the key was created for.
|
|
2858
|
+
*/
|
|
2859
|
+
recordName: string;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
/**
|
|
2863
|
+
* Defines an interface that represents a failed "create public record key" result.
|
|
2864
|
+
*/
|
|
2865
|
+
export interface CreatePublicRecordKeyFailure {
|
|
2866
|
+
/**
|
|
2867
|
+
* Whether the operation was successful.
|
|
2868
|
+
*/
|
|
2869
|
+
success: false;
|
|
2870
|
+
|
|
2871
|
+
/**
|
|
2872
|
+
* The type of error that occurred.
|
|
2873
|
+
*/
|
|
2874
|
+
errorCode: UnauthorizedToCreateRecordKeyError | GeneralRecordError;
|
|
2875
|
+
|
|
2876
|
+
/**
|
|
2877
|
+
* The error message.
|
|
2878
|
+
*/
|
|
2879
|
+
errorMessage: string;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
/**
|
|
2883
|
+
* Defines an error that occurs when a user is not authorized to create a key for the public record.
|
|
2884
|
+
* This may happen when the user is not the owner of the record.
|
|
2885
|
+
*/
|
|
2886
|
+
export type UnauthorizedToCreateRecordKeyError =
|
|
2887
|
+
'unauthorized_to_create_record_key';
|
|
2888
|
+
|
|
2889
|
+
/**
|
|
2890
|
+
* Defines an error that occurs when an unspecified error occurs while creating a public record key.
|
|
2891
|
+
*/
|
|
2892
|
+
export type GeneralRecordError = 'general_record_error';
|
|
2893
|
+
|
|
2894
|
+
/**
|
|
2895
|
+
* Defines an error that occurs when an unspecified error occurs while creating a public record key.
|
|
2896
|
+
*/
|
|
2897
|
+
export type InvalidRecordKey = 'invalid_record_key';
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* Defines an error that occurs when an unspecified error occurs while creating a public record key.
|
|
2901
|
+
*/
|
|
2902
|
+
export type ServerError = 'server_error';
|
|
2903
|
+
|
|
2904
|
+
/**
|
|
2905
|
+
* Defines an error that occurs when the user is not logged in but they are required to be in order to perform an action.
|
|
2906
|
+
*/
|
|
2907
|
+
export type NotLoggedInError = 'not_logged_in';
|
|
2908
|
+
|
|
2909
|
+
export type RecordNotFoundError = 'record_not_found';
|
|
2910
|
+
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
export type RecordDataResult = RecordDataSuccess | RecordDataFailure;
|
|
2914
|
+
|
|
2915
|
+
export interface RecordDataSuccess {
|
|
2916
|
+
success: true;
|
|
2917
|
+
recordName: string;
|
|
2918
|
+
address: string;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
export interface RecordDataFailure {
|
|
2922
|
+
success: false;
|
|
2923
|
+
errorCode:
|
|
2924
|
+
| ServerError
|
|
2925
|
+
| NotLoggedInError
|
|
2926
|
+
| InvalidRecordKey
|
|
2927
|
+
| RecordNotFoundError
|
|
2928
|
+
| 'data_too_large';
|
|
2929
|
+
errorMessage: string;
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
export type GetDataResult = GetDataSuccess | GetDataFailure;
|
|
2933
|
+
|
|
2934
|
+
/**
|
|
2935
|
+
* Defines an interface that represents a successful "get data" result.
|
|
2936
|
+
*/
|
|
2937
|
+
export interface GetDataSuccess {
|
|
2938
|
+
success: true;
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* The data that was stored.
|
|
2942
|
+
*/
|
|
2943
|
+
data: any;
|
|
2944
|
+
|
|
2945
|
+
/**
|
|
2946
|
+
* The name of the record.
|
|
2947
|
+
*/
|
|
2948
|
+
recordName: string;
|
|
2949
|
+
|
|
2950
|
+
/**
|
|
2951
|
+
* The ID of the user that owns the record.
|
|
2952
|
+
*/
|
|
2953
|
+
publisherId: string;
|
|
2954
|
+
|
|
2955
|
+
/**
|
|
2956
|
+
* The ID of the user that sent the data.
|
|
2957
|
+
*/
|
|
2958
|
+
subjectId: string;
|
|
2959
|
+
}
|
|
2960
|
+
|
|
2961
|
+
export interface GetDataFailure {
|
|
2962
|
+
success: false;
|
|
2963
|
+
errorCode: ServerError | 'data_not_found';
|
|
2964
|
+
errorMessage: string;
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
export type RecordFileResult = RecordFileSuccess | RecordFileFailure;
|
|
2969
|
+
|
|
2970
|
+
export interface RecordFileSuccess {
|
|
2971
|
+
success: true;
|
|
2972
|
+
|
|
2973
|
+
/**
|
|
2974
|
+
* The URL that the file can be accessed at.
|
|
2975
|
+
*/
|
|
2976
|
+
url: string;
|
|
2977
|
+
|
|
2978
|
+
/**
|
|
2979
|
+
* The SHA-256 hash of the file.
|
|
2980
|
+
* When downloading the URL, the resulting data is guaranteed to have a SHA-256 hash that matches this value.
|
|
2981
|
+
*/
|
|
2982
|
+
sha256Hash: string;
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
export interface RecordFileFailure {
|
|
2986
|
+
success: false;
|
|
2987
|
+
errorCode:
|
|
2988
|
+
| ServerError
|
|
2989
|
+
| NotLoggedInError
|
|
2990
|
+
| InvalidRecordKey
|
|
2991
|
+
| RecordNotFoundError
|
|
2992
|
+
| 'file_already_exists'
|
|
2993
|
+
| 'invalid_file_data';
|
|
2994
|
+
errorMessage: string;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
|
|
2895
2998
|
declare global {
|
|
2896
2999
|
|
|
2897
3000
|
/**
|
|
@@ -3072,7 +3175,39 @@ declare global {
|
|
|
3072
3175
|
* // Tell every bot say "Hi" to you.
|
|
3073
3176
|
* shout("sayHi()", "My Name");
|
|
3074
3177
|
*/
|
|
3075
|
-
|
|
3178
|
+
const shout: {
|
|
3179
|
+
/**
|
|
3180
|
+
* Asks every bot in the inst to run the given action.
|
|
3181
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
3182
|
+
*
|
|
3183
|
+
* @param name The event name.
|
|
3184
|
+
* @param arg The optional argument to include in the shout.
|
|
3185
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
3186
|
+
*
|
|
3187
|
+
* @example
|
|
3188
|
+
* // Tell every bot to reset themselves.
|
|
3189
|
+
* shout("reset()");
|
|
3190
|
+
*
|
|
3191
|
+
* @example
|
|
3192
|
+
* // Ask every bot for its name.
|
|
3193
|
+
* const names = shout("getName()");
|
|
3194
|
+
*
|
|
3195
|
+
* @example
|
|
3196
|
+
* // Tell every bot say "Hi" to you.
|
|
3197
|
+
* shout("sayHi()", "My Name");
|
|
3198
|
+
*/
|
|
3199
|
+
(name: string, arg?: any): any[],
|
|
3200
|
+
[name: string]: {
|
|
3201
|
+
/**
|
|
3202
|
+
* Asks every bot in the inst to run the given action.
|
|
3203
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
3204
|
+
*
|
|
3205
|
+
* @param arg The optional argument to include in the shout.
|
|
3206
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
3207
|
+
*/
|
|
3208
|
+
(arg?: any): any[]
|
|
3209
|
+
}
|
|
3210
|
+
};
|
|
3076
3211
|
|
|
3077
3212
|
/**
|
|
3078
3213
|
* Asks the given bots to run the given action.
|
|
@@ -3465,30 +3600,6 @@ declare global {
|
|
|
3465
3600
|
*/
|
|
3466
3601
|
function not(filter: BotFilterFunction): BotFilterFunction;
|
|
3467
3602
|
|
|
3468
|
-
/**
|
|
3469
|
-
* Creates a record filter that retrieves records created by the given Auth ID.
|
|
3470
|
-
* @param authID The ID of the creator of the records.
|
|
3471
|
-
*/
|
|
3472
|
-
function byAuthID(authID: string): AuthIdRecordFilter;
|
|
3473
|
-
|
|
3474
|
-
/**
|
|
3475
|
-
* Creates a record filter that retrieves records with the given address.
|
|
3476
|
-
* @param address The address that the record was stored at.
|
|
3477
|
-
*/
|
|
3478
|
-
function byAddress(address: string): AddressRecordFilter;
|
|
3479
|
-
|
|
3480
|
-
/**
|
|
3481
|
-
* Creates a record filter that retrieves records with the given address.
|
|
3482
|
-
* @param token The auth token that should be used to authenticate the getRecords() request.
|
|
3483
|
-
*/
|
|
3484
|
-
function withAuthToken(token: string): AuthTokenRecordFilter;
|
|
3485
|
-
|
|
3486
|
-
/**
|
|
3487
|
-
* Creates a record filter that retrieves records with the given prefix in their address.
|
|
3488
|
-
* @param prefix The prefix that should be matched to record addresses.
|
|
3489
|
-
*/
|
|
3490
|
-
function byPrefix(prefix: string): PrefixRecordFilter;
|
|
3491
|
-
|
|
3492
3603
|
/**
|
|
3493
3604
|
* Gets the value of the given tag stored in the given bot.
|
|
3494
3605
|
* @param bot The bot.
|
|
@@ -4238,30 +4349,6 @@ interface Debugger {
|
|
|
4238
4349
|
*/
|
|
4239
4350
|
not(filter: BotFilterFunction): BotFilterFunction;
|
|
4240
4351
|
|
|
4241
|
-
/**
|
|
4242
|
-
* Creates a record filter that retrieves records created by the given Auth ID.
|
|
4243
|
-
* @param authID The ID of the creator of the records.
|
|
4244
|
-
*/
|
|
4245
|
-
byAuthID(authID: string): AuthIdRecordFilter;
|
|
4246
|
-
|
|
4247
|
-
/**
|
|
4248
|
-
* Creates a record filter that retrieves records with the given address.
|
|
4249
|
-
* @param address The address that the record was stored at.
|
|
4250
|
-
*/
|
|
4251
|
-
byAddress(address: string): AddressRecordFilter;
|
|
4252
|
-
|
|
4253
|
-
/**
|
|
4254
|
-
* Creates a record filter that retrieves records with the given address.
|
|
4255
|
-
* @param token The auth token that should be used to authenticate the getRecords() request.
|
|
4256
|
-
*/
|
|
4257
|
-
withAuthToken(token: string): AuthTokenRecordFilter;
|
|
4258
|
-
|
|
4259
|
-
/**
|
|
4260
|
-
* Creates a record filter that retrieves records with the given prefix in their address.
|
|
4261
|
-
* @param prefix The prefix that should be matched to record addresses.
|
|
4262
|
-
*/
|
|
4263
|
-
byPrefix(prefix: string): PrefixRecordFilter;
|
|
4264
|
-
|
|
4265
4352
|
/**
|
|
4266
4353
|
* Gets the value of the given tag stored in the given bot.
|
|
4267
4354
|
* @param bot The bot.
|
|
@@ -4452,6 +4539,22 @@ interface Debugger {
|
|
|
4452
4539
|
perf: Perf;
|
|
4453
4540
|
}
|
|
4454
4541
|
|
|
4542
|
+
/**
|
|
4543
|
+
* Defines an interface that represents the set of additional options that can be provided when recording a file.
|
|
4544
|
+
*/
|
|
4545
|
+
interface RecordFileOptions {
|
|
4546
|
+
/**
|
|
4547
|
+
* The description of the file.
|
|
4548
|
+
*/
|
|
4549
|
+
description?: string;
|
|
4550
|
+
|
|
4551
|
+
/**
|
|
4552
|
+
* The MIME type of the file.
|
|
4553
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types for more information.
|
|
4554
|
+
*/
|
|
4555
|
+
mimeType?: string;
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4455
4558
|
interface Os {
|
|
4456
4559
|
/**
|
|
4457
4560
|
* Sleeps for time in ms.
|
|
@@ -5074,35 +5177,80 @@ interface Os {
|
|
|
5074
5177
|
*/
|
|
5075
5178
|
requestAuthBot(): Promise<Bot>;
|
|
5076
5179
|
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5180
|
+
/**
|
|
5181
|
+
* Gets an access key for the given public record.
|
|
5182
|
+
* @param name The name of the record.
|
|
5183
|
+
*/
|
|
5184
|
+
getPublicRecordKey(recordName: string): Promise<CreatePublicRecordKeyResult>;
|
|
5081
5185
|
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5186
|
+
/**
|
|
5187
|
+
* Determines if the given value is a record key.
|
|
5188
|
+
* @param key The value to check.
|
|
5189
|
+
*/
|
|
5190
|
+
isRecordKey(key: unknown): boolean;
|
|
5191
|
+
|
|
5192
|
+
/**
|
|
5193
|
+
* Records the given data to the given address inside the record for the given record key.
|
|
5194
|
+
* @param recordKey The key that should be used to access the record.
|
|
5195
|
+
* @param address The address that the data should be stored at inside the record.
|
|
5196
|
+
* @param data The data that should be stored.
|
|
5197
|
+
*/
|
|
5198
|
+
recordData(
|
|
5199
|
+
recordKey: string,
|
|
5200
|
+
address: string,
|
|
5201
|
+
data: any
|
|
5202
|
+
): Promise<RecordDataResult>;
|
|
5203
|
+
|
|
5204
|
+
/**
|
|
5205
|
+
* Gets the data stored in the given record at the given address.
|
|
5206
|
+
* @param recordKeyOrName The record that the data should be retrieved from.
|
|
5207
|
+
* @param address The address that the data is stored at.
|
|
5208
|
+
*/
|
|
5209
|
+
getData(
|
|
5210
|
+
recordKeyOrName: string,
|
|
5211
|
+
address: string
|
|
5212
|
+
): Promise<GetDataResult>;
|
|
5213
|
+
|
|
5214
|
+
/**
|
|
5215
|
+
* Records the given data as a file.
|
|
5216
|
+
* @param recordKey The record that the file should be recorded in.
|
|
5217
|
+
* @param data The data that should be recorded.
|
|
5218
|
+
* @param options The options that should be used to record the file.
|
|
5219
|
+
*/
|
|
5220
|
+
recordFile(
|
|
5221
|
+
recordKey: string,
|
|
5222
|
+
data: any,
|
|
5223
|
+
options?: RecordFileOptions
|
|
5224
|
+
): Promise<RecordFileResult>;
|
|
5087
5225
|
|
|
5226
|
+
/**
|
|
5227
|
+
* Gets the data stored in the given file.
|
|
5228
|
+
* @param result The successful result of a os.recordFile() call.
|
|
5229
|
+
*/
|
|
5230
|
+
getFile(result: RecordFileSuccess): Promise<any>;
|
|
5088
5231
|
/**
|
|
5089
|
-
*
|
|
5090
|
-
* @param
|
|
5232
|
+
* Gets the data stored in the given file.
|
|
5233
|
+
* @param url The URL that the file is stored at.
|
|
5091
5234
|
*/
|
|
5092
|
-
|
|
5093
|
-
|
|
5235
|
+
getFile(url: string): Promise<any>;
|
|
5094
5236
|
/**
|
|
5095
|
-
*
|
|
5096
|
-
* @param
|
|
5237
|
+
* Gets the data stored in the given file.
|
|
5238
|
+
* @param urlOrRecordFileResult The URL or the successful result of the record file operation.
|
|
5097
5239
|
*/
|
|
5098
|
-
|
|
5240
|
+
getFile(urlOrRecordFileResult: string | RecordFileSuccess): Promise<any>;
|
|
5241
|
+
|
|
5242
|
+
/**
|
|
5243
|
+
* Converts the given geolocation to a what3words (https://what3words.com/) address.
|
|
5244
|
+
* @param location The latitude and longitude that should be converted to a 3 word address.
|
|
5245
|
+
*/
|
|
5246
|
+
convertGeolocationToWhat3Words(location: ConvertGeolocationToWhat3WordsOptions): Promise<string>;
|
|
5099
5247
|
|
|
5100
5248
|
/**
|
|
5101
5249
|
* Specifies that the given prefix should be interpreted as code.
|
|
5102
5250
|
* @param prefix The prefix that code tags should start with.
|
|
5103
5251
|
* @param options The options that should be used for the prefix.
|
|
5104
5252
|
*/
|
|
5105
|
-
|
|
5253
|
+
registerTagPrefix(prefix: string, options?: RegisterPrefixOptions): Promise<void>;
|
|
5106
5254
|
|
|
5107
5255
|
/**
|
|
5108
5256
|
* Gets the number of devices that are viewing the current inst.
|
|
@@ -5150,6 +5298,11 @@ interface Os {
|
|
|
5150
5298
|
* Gets the debugger that this script is currently running in.
|
|
5151
5299
|
*/
|
|
5152
5300
|
getExecutingDebugger(): Debugger;
|
|
5301
|
+
|
|
5302
|
+
/**
|
|
5303
|
+
* The global variables that are stored in the OS.
|
|
5304
|
+
*/
|
|
5305
|
+
vars: typeof globalThis;
|
|
5153
5306
|
}
|
|
5154
5307
|
|
|
5155
5308
|
interface Server {
|
package/runtime/AuxRuntime.js
CHANGED
|
@@ -12,7 +12,7 @@ import { addToContext, MemoryGlobalContext, removeFromContext, isInContext, } fr
|
|
|
12
12
|
import { createDefaultLibrary, } from './AuxLibrary';
|
|
13
13
|
import { createRuntimeBot, RealtimeEditMode, } from './RuntimeBot';
|
|
14
14
|
import { RanOutOfEnergyError } from './AuxResults';
|
|
15
|
-
import { convertToCopiableValue, DeepObjectError,
|
|
15
|
+
import { convertToCopiableValue, DeepObjectError, } from './Utils';
|
|
16
16
|
import { DefaultRealtimeEditModeProvider, } from './AuxRealtimeEditModeProvider';
|
|
17
17
|
import { sortBy, forOwn, merge, union } from 'lodash';
|
|
18
18
|
import { tagValueHash } from '../aux-format-2/AuxOpTypes';
|
|
@@ -326,12 +326,6 @@ export class AuxRuntime {
|
|
|
326
326
|
this._processCore([asyncResult(action.taskId, null)]);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
else if (action.type === 'update_auth_data') {
|
|
330
|
-
const bot = this._compiledState[action.data.userId];
|
|
331
|
-
if (bot) {
|
|
332
|
-
this.updateTag(bot, 'authToken', formatAuthToken(action.data.token, action.data.service));
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
329
|
else {
|
|
336
330
|
this._actionBatch.push(action);
|
|
337
331
|
}
|
|
@@ -1254,7 +1248,7 @@ export class AuxRuntime {
|
|
|
1254
1248
|
throw data;
|
|
1255
1249
|
},
|
|
1256
1250
|
constants: Object.assign(Object.assign({}, this._library.api), { tagName: tag, globalThis: this._globalObject }),
|
|
1257
|
-
variables: Object.assign(Object.assign({}, this._library.tagSpecificApi), { this: (ctx) => (ctx.bot ? ctx.bot.script : null), thisBot: (ctx) => (ctx.bot ? ctx.bot.script : null), bot: (ctx) => (ctx.bot ? ctx.bot.script : null), tags: (ctx) => (ctx.bot ? ctx.bot.script.tags : null), raw: (ctx) => (ctx.bot ? ctx.bot.script.raw : null), masks: (ctx) => (ctx.bot ? ctx.bot.script.masks : null), creatorBot: (ctx) => ctx.creator, configBot: () => this.context.playerBot }),
|
|
1251
|
+
variables: Object.assign(Object.assign({}, this._library.tagSpecificApi), { this: (ctx) => (ctx.bot ? ctx.bot.script : null), thisBot: (ctx) => (ctx.bot ? ctx.bot.script : null), bot: (ctx) => (ctx.bot ? ctx.bot.script : null), tags: (ctx) => (ctx.bot ? ctx.bot.script.tags : null), raw: (ctx) => (ctx.bot ? ctx.bot.script.raw : null), masks: (ctx) => (ctx.bot ? ctx.bot.script.masks : null), creatorBot: (ctx) => ctx.creator, configBot: () => this.context.playerBot, links: (ctx) => (ctx.bot ? ctx.bot.script.links : null) }),
|
|
1258
1252
|
arguments: [['that', 'data']],
|
|
1259
1253
|
});
|
|
1260
1254
|
if (hasValue(bot)) {
|