@devvit/public-api 0.10.23-next-2024-06-11-a1863df2d.0 → 0.10.23-next-2024-06-12-094f12978.0

Sign up to get free protection for your applications and to get access to all the features.
package/meta.min.json CHANGED
@@ -2682,7 +2682,7 @@
2682
2682
  "format": "esm"
2683
2683
  },
2684
2684
  "src/apis/AssetsClient/AssetsClient.ts": {
2685
- "bytes": 2616,
2685
+ "bytes": 3387,
2686
2686
  "imports": [
2687
2687
  {
2688
2688
  "path": "src/devvit/Devvit.ts",
@@ -2746,7 +2746,7 @@
2746
2746
  "format": "esm"
2747
2747
  },
2748
2748
  "src/apis/reddit/RedditAPIClient.ts": {
2749
- "bytes": 55170,
2749
+ "bytes": 55182,
2750
2750
  "imports": [
2751
2751
  {
2752
2752
  "path": "../shared-types/dist/Header.js",
@@ -2989,8 +2989,12 @@
2989
2989
  ],
2990
2990
  "format": "esm"
2991
2991
  },
2992
+ "package.json": {
2993
+ "bytes": 2832,
2994
+ "imports": []
2995
+ },
2992
2996
  "src/devvit/internals/context.ts": {
2993
- "bytes": 2390,
2997
+ "bytes": 2686,
2994
2998
  "imports": [
2995
2999
  {
2996
3000
  "path": "../shared-types/dist/Header.js",
@@ -3001,6 +3005,11 @@
3001
3005
  "path": "../shared-types/dist/NonNull.js",
3002
3006
  "kind": "import-statement",
3003
3007
  "original": "@devvit/shared-types/NonNull.js"
3008
+ },
3009
+ {
3010
+ "path": "package.json",
3011
+ "kind": "import-statement",
3012
+ "original": "../../../package.json"
3004
3013
  }
3005
3014
  ],
3006
3015
  "format": "esm"
@@ -3089,7 +3098,7 @@
3089
3098
  "format": "esm"
3090
3099
  },
3091
3100
  "src/devvit/internals/blocks/BlocksTransformer.ts": {
3092
- "bytes": 28008,
3101
+ "bytes": 28076,
3093
3102
  "imports": [
3094
3103
  {
3095
3104
  "path": "@devvit/protos",
@@ -3774,7 +3783,7 @@
3774
3783
  "format": "esm"
3775
3784
  },
3776
3785
  "src/devvit/Devvit.ts": {
3777
- "bytes": 34066,
3786
+ "bytes": 34324,
3778
3787
  "imports": [
3779
3788
  {
3780
3789
  "path": "@devvit/protos",
@@ -4079,7 +4088,7 @@
4079
4088
  "format": "esm"
4080
4089
  },
4081
4090
  "src/apis/reddit/models/User.ts": {
4082
- "bytes": 16697,
4091
+ "bytes": 16659,
4083
4092
  "imports": [
4084
4093
  {
4085
4094
  "path": "../shared-types/dist/NonNull.js",
@@ -4633,7 +4642,7 @@
4633
4642
  "imports": [],
4634
4643
  "exports": [],
4635
4644
  "inputs": {},
4636
- "bytes": 1128925
4645
+ "bytes": 1135001
4637
4646
  },
4638
4647
  "dist/public-api.min.js": {
4639
4648
  "imports": [
@@ -5169,7 +5178,7 @@
5169
5178
  "bytesInOutput": 1365
5170
5179
  },
5171
5180
  "src/devvit/Devvit.ts": {
5172
- "bytesInOutput": 5891
5181
+ "bytesInOutput": 6011
5173
5182
  },
5174
5183
  "../shared-types/dist/Actor.js": {
5175
5184
  "bytesInOutput": 31
@@ -5220,7 +5229,7 @@
5220
5229
  "bytesInOutput": 502
5221
5230
  },
5222
5231
  "src/apis/AssetsClient/AssetsClient.ts": {
5223
- "bytesInOutput": 550
5232
+ "bytesInOutput": 714
5224
5233
  },
5225
5234
  "src/apis/key-value-storage/KeyValueStorage.ts": {
5226
5235
  "bytesInOutput": 456
@@ -5258,8 +5267,11 @@
5258
5267
  "src/apis/makeAPIClients.ts": {
5259
5268
  "bytesInOutput": 848
5260
5269
  },
5270
+ "package.json": {
5271
+ "bytesInOutput": 2390
5272
+ },
5261
5273
  "src/devvit/internals/context.ts": {
5262
- "bytesInOutput": 849
5274
+ "bytesInOutput": 940
5263
5275
  },
5264
5276
  "src/devvit/internals/custom-post.ts": {
5265
5277
  "bytesInOutput": 350
@@ -5274,7 +5286,7 @@
5274
5286
  "bytesInOutput": 101
5275
5287
  },
5276
5288
  "src/devvit/internals/blocks/BlocksTransformer.ts": {
5277
- "bytesInOutput": 12236
5289
+ "bytesInOutput": 12253
5278
5290
  },
5279
5291
  "src/devvit/internals/semanticColors.ts": {
5280
5292
  "bytesInOutput": 11055
@@ -5370,7 +5382,7 @@
5370
5382
  "bytesInOutput": 12604
5371
5383
  },
5372
5384
  "src/apis/reddit/models/User.ts": {
5373
- "bytesInOutput": 5260
5385
+ "bytesInOutput": 5219
5374
5386
  },
5375
5387
  "src/apis/reddit/models/Comment.ts": {
5376
5388
  "bytesInOutput": 9032
@@ -5415,7 +5427,7 @@
5415
5427
  "bytesInOutput": 2042
5416
5428
  }
5417
5429
  },
5418
- "bytes": 240128
5430
+ "bytes": 242869
5419
5431
  }
5420
5432
  }
5421
5433
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/public-api",
3
- "version": "0.10.23-next-2024-06-11-a1863df2d.0",
3
+ "version": "0.10.23-next-2024-06-12-094f12978.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "main": "./index.js",
11
11
  "scripts": {
12
- "build": "yarn build:icon-types && yarn build:semantic-colors && tsc && cp -a devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin",
12
+ "build": "yarn build:icon-types && yarn build:semantic-colors && tsc && cp -af package.json devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin",
13
13
  "build:icon-types": "make-icons src/types/icons.ts",
14
14
  "build:min": "esbuild --bundle --sourcemap=linked --target=es2020 --format=esm --metafile=dist/meta.min.json --outfile=dist/public-api.min.js --external:@devvit/protos --minify src/index.ts",
15
15
  "build:semantic-colors": "node scripts/make-semantic-colors.js",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "types": "./index.d.ts",
32
32
  "dependencies": {
33
- "@devvit/protos": "0.10.23-next-2024-06-11-a1863df2d.0",
34
- "@devvit/shared-types": "0.10.23-next-2024-06-11-a1863df2d.0",
33
+ "@devvit/protos": "0.10.23-next-2024-06-12-094f12978.0",
34
+ "@devvit/shared-types": "0.10.23-next-2024-06-12-094f12978.0",
35
35
  "base64-js": "1.5.1",
36
36
  "clone-deep": "4.0.1",
37
37
  "core-js": "3.27.2",
@@ -41,7 +41,7 @@
41
41
  "@ampproject/filesize": "4.3.0",
42
42
  "@devvit/eslint-config": "0.10.22",
43
43
  "@devvit/repo-tools": "0.10.22",
44
- "@devvit/tsconfig": "0.10.23-next-2024-06-11-a1863df2d.0",
44
+ "@devvit/tsconfig": "0.10.23-next-2024-06-12-094f12978.0",
45
45
  "@microsoft/api-extractor": "7.41.0",
46
46
  "@reddit/faceplate-ui": "11.3.3",
47
47
  "@types/clone-deep": "4.0.1",
@@ -64,5 +64,5 @@
64
64
  }
65
65
  },
66
66
  "source": "./src/index.ts",
67
- "gitHead": "e6fc1cf72a27729540706a5f45ff5cbaab3b0a28"
67
+ "gitHead": "507383b76a8acca35658808e48fc514d128bd982"
68
68
  }
package/public-api.d.ts CHANGED
@@ -1447,15 +1447,18 @@ declare class AssetsClient {
1447
1447
  /**
1448
1448
  * Gets the public URLs for an asset.
1449
1449
  * @param assetPath A path, relative to the 'assets/' folder.
1450
+ * @param options
1450
1451
  * @returns The public URL for that asset (https://i.redd.it/<id>.<ext>)
1451
1452
  */
1452
1453
  getURL(assetPath: string): string;
1454
+ getURL(assetPath: string, options: GetURLOptions | undefined): string;
1453
1455
  /**
1454
1456
  * Gets the public URLs for multiple assets.
1455
1457
  * @param assetPaths An array of paths, relative to the 'assets/' folder.
1456
1458
  * @returns A map of each asset path to its public URL (https://i.redd.it/<id>.<ext>)
1457
1459
  */
1458
1460
  getURL(assetPaths: string[]): AssetMap;
1461
+ getURL(assetPaths: string[], options: GetURLOptions | undefined): AssetMap;
1459
1462
  }
1460
1463
 
1461
1464
  export declare type AsyncError = {
@@ -2864,6 +2867,9 @@ declare const BootstrapActorDefinition: {
2864
2867
  assets?: {
2865
2868
  [x: string]: string | undefined;
2866
2869
  };
2870
+ webviewAssets?: {
2871
+ [x: string]: string | undefined;
2872
+ };
2867
2873
  } | undefined): LinkedBundle;
2868
2874
  fromPartial(object: {
2869
2875
  actor?: {
@@ -2897,6 +2903,9 @@ declare const BootstrapActorDefinition: {
2897
2903
  assets?: {
2898
2904
  [x: string]: string | undefined;
2899
2905
  };
2906
+ webviewAssets?: {
2907
+ [x: string]: string | undefined;
2908
+ };
2900
2909
  }): LinkedBundle;
2901
2910
  };
2902
2911
  readonly requestStream: false;
@@ -3338,6 +3347,9 @@ declare const BuildPackDefinition: {
3338
3347
  assetIds?: {
3339
3348
  [x: string]: string | undefined;
3340
3349
  };
3350
+ webviewAssetIds?: {
3351
+ [x: string]: string | undefined;
3352
+ };
3341
3353
  } | undefined;
3342
3354
  errors?: {
3343
3355
  detail?: {
@@ -3419,6 +3431,9 @@ declare const BuildPackDefinition: {
3419
3431
  assetIds?: {
3420
3432
  [x: string]: string | undefined;
3421
3433
  };
3434
+ webviewAssetIds?: {
3435
+ [x: string]: string | undefined;
3436
+ };
3422
3437
  } | undefined;
3423
3438
  errors?: {
3424
3439
  detail?: {
@@ -3557,6 +3572,9 @@ declare const BuildPackDefinition: {
3557
3572
  assetIds?: {
3558
3573
  [x: string]: string | undefined;
3559
3574
  };
3575
+ webviewAssetIds?: {
3576
+ [x: string]: string | undefined;
3577
+ };
3560
3578
  } | undefined;
3561
3579
  errors?: {
3562
3580
  detail?: {
@@ -3638,6 +3656,9 @@ declare const BuildPackDefinition: {
3638
3656
  assetIds?: {
3639
3657
  [x: string]: string | undefined;
3640
3658
  };
3659
+ webviewAssetIds?: {
3660
+ [x: string]: string | undefined;
3661
+ };
3641
3662
  } | undefined;
3642
3663
  errors?: {
3643
3664
  detail?: {
@@ -3978,6 +3999,14 @@ declare interface Bundle {
3978
3999
  assetIds: {
3979
4000
  [key: string]: string;
3980
4001
  };
4002
+ /**
4003
+ * This map contains html assets from the webroot directory for use in a webview.
4004
+ * It has the same structure as asset_ids but is rooted in the webroot directory
4005
+ * and is isolated from regular assets.
4006
+ */
4007
+ webviewAssetIds: {
4008
+ [key: string]: string;
4009
+ };
3981
4010
  }
3982
4011
 
3983
4012
  declare const Bundle: {
@@ -4005,6 +4034,21 @@ declare const Bundle_AssetIdsEntry: {
4005
4034
  fromPartial(object: DeepPartial_23<Bundle_AssetIdsEntry>): Bundle_AssetIdsEntry;
4006
4035
  };
4007
4036
 
4037
+ declare interface Bundle_WebviewAssetIdsEntry {
4038
+ key: string;
4039
+ value: string;
4040
+ }
4041
+
4042
+ declare const Bundle_WebviewAssetIdsEntry: {
4043
+ $type: "devvit.plugin.buildpack.Bundle.WebviewAssetIdsEntry";
4044
+ encode(message: Bundle_WebviewAssetIdsEntry, writer?: _m0.Writer): _m0.Writer;
4045
+ decode(input: _m0.Reader | Uint8Array, length?: number): Bundle_WebviewAssetIdsEntry;
4046
+ fromJSON(object: any): Bundle_WebviewAssetIdsEntry;
4047
+ toJSON(message: Bundle_WebviewAssetIdsEntry): unknown;
4048
+ create(base?: DeepPartial_23<Bundle_WebviewAssetIdsEntry>): Bundle_WebviewAssetIdsEntry;
4049
+ fromPartial(object: DeepPartial_23<Bundle_WebviewAssetIdsEntry>): Bundle_WebviewAssetIdsEntry;
4050
+ };
4051
+
4008
4052
  /** Fetch a bundle by its hostname */
4009
4053
  declare interface BundleRequest {
4010
4054
  /** Must be legal name for filesystem. Eg, LinkedBundle.hostname. 'main.local' */
@@ -4085,6 +4129,9 @@ declare const BundleServiceDefinition: {
4085
4129
  assets?: {
4086
4130
  [x: string]: string | undefined;
4087
4131
  };
4132
+ webviewAssets?: {
4133
+ [x: string]: string | undefined;
4134
+ };
4088
4135
  } | undefined): LinkedBundle;
4089
4136
  fromPartial(object: {
4090
4137
  actor?: {
@@ -4118,6 +4165,9 @@ declare const BundleServiceDefinition: {
4118
4165
  assets?: {
4119
4166
  [x: string]: string | undefined;
4120
4167
  };
4168
+ webviewAssets?: {
4169
+ [x: string]: string | undefined;
4170
+ };
4121
4171
  }): LinkedBundle;
4122
4172
  };
4123
4173
  readonly requestStream: false;
@@ -4184,6 +4234,9 @@ declare const BundleServiceDefinition: {
4184
4234
  assets?: {
4185
4235
  [x: string]: string | undefined;
4186
4236
  };
4237
+ webviewAssets?: {
4238
+ [x: string]: string | undefined;
4239
+ };
4187
4240
  } | undefined): LinkedBundle;
4188
4241
  fromPartial(object: {
4189
4242
  actor?: {
@@ -4217,6 +4270,9 @@ declare const BundleServiceDefinition: {
4217
4270
  assets?: {
4218
4271
  [x: string]: string | undefined;
4219
4272
  };
4273
+ webviewAssets?: {
4274
+ [x: string]: string | undefined;
4275
+ };
4220
4276
  }): LinkedBundle;
4221
4277
  };
4222
4278
  readonly responseStream: false;
@@ -5334,6 +5390,7 @@ declare const ComposeRequest: {
5334
5390
  declare type Config = {
5335
5391
  readonly assets: Readonly<AssetMap>;
5336
5392
  readonly providedDefinitions: Readonly<Definition>[];
5393
+ readonly webviewAssets?: Readonly<AssetMap> | undefined;
5337
5394
  export(namespace: Readonly<Namespace>): DependencySpec;
5338
5395
  provides(definition: Readonly<Definition>): void;
5339
5396
  use<T>(definition: Readonly<Definition>, options?: Readonly<DeepPartial_15<PackageQuery>>): T;
@@ -13857,6 +13914,8 @@ declare const GetActionsResponse: {
13857
13914
  declare interface GetAssetURLRequest {
13858
13915
  /** The path to the asset relative to the /assets directory of the project */
13859
13916
  path: string;
13917
+ /** If true, look for a webview asset instead of a standard asset */
13918
+ webview?: boolean | undefined;
13860
13919
  }
13861
13920
 
13862
13921
  declare const GetAssetURLRequest: {
@@ -14674,6 +14733,10 @@ export declare type GetSubredditUsersByTypeOptions = ListingFetchOptions & {
14674
14733
 
14675
14734
  declare type GetSubredditUsersOptions = Omit<GetSubredditUsersByTypeOptions, 'type'>;
14676
14735
 
14736
+ declare type GetURLOptions = {
14737
+ webview?: boolean | undefined;
14738
+ };
14739
+
14677
14740
  export declare type GetUserFlairBySubredditOptions = UserFlairPageOptions & {
14678
14741
  /** The subreddit associated with the flair being retrieved. */
14679
14742
  subreddit: string;
@@ -17225,6 +17288,13 @@ declare interface LinkedBundle {
17225
17288
  assets: {
17226
17289
  [key: string]: string;
17227
17290
  };
17291
+ /**
17292
+ * This map is used to resolve assets for the webview block. It will only
17293
+ * contain references to the html files in the webroot assets directory.
17294
+ */
17295
+ webviewAssets: {
17296
+ [key: string]: string;
17297
+ };
17228
17298
  }
17229
17299
 
17230
17300
  declare const LinkedBundle: {
@@ -17252,6 +17322,21 @@ declare const LinkedBundle_AssetsEntry: {
17252
17322
  fromPartial(object: DeepPartial_14<LinkedBundle_AssetsEntry>): LinkedBundle_AssetsEntry;
17253
17323
  };
17254
17324
 
17325
+ declare interface LinkedBundle_WebviewAssetsEntry {
17326
+ key: string;
17327
+ value: string;
17328
+ }
17329
+
17330
+ declare const LinkedBundle_WebviewAssetsEntry: {
17331
+ $type: "devvit.runtime.LinkedBundle.WebviewAssetsEntry";
17332
+ encode(message: LinkedBundle_WebviewAssetsEntry, writer?: _m0.Writer): _m0.Writer;
17333
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedBundle_WebviewAssetsEntry;
17334
+ fromJSON(object: any): LinkedBundle_WebviewAssetsEntry;
17335
+ toJSON(message: LinkedBundle_WebviewAssetsEntry): unknown;
17336
+ create(base?: DeepPartial_14<LinkedBundle_WebviewAssetsEntry>): LinkedBundle_WebviewAssetsEntry;
17337
+ fromPartial(object: DeepPartial_14<LinkedBundle_WebviewAssetsEntry>): LinkedBundle_WebviewAssetsEntry;
17338
+ };
17339
+
17255
17340
  /** See also LinkedBundle. */
17256
17341
  declare enum LinkedBundleTargetPlatform {
17257
17342
  /** BROWSER - A LinkedBundle for browser runtimes. */
@@ -17371,6 +17456,9 @@ declare const LinkerDefinition: {
17371
17456
  assetIds?: {
17372
17457
  [x: string]: string | undefined;
17373
17458
  };
17459
+ webviewAssetIds?: {
17460
+ [x: string]: string | undefined;
17461
+ };
17374
17462
  } | undefined): Bundle;
17375
17463
  fromPartial(object: {
17376
17464
  code?: string;
@@ -17430,6 +17518,9 @@ declare const LinkerDefinition: {
17430
17518
  assetIds?: {
17431
17519
  [x: string]: string | undefined;
17432
17520
  };
17521
+ webviewAssetIds?: {
17522
+ [x: string]: string | undefined;
17523
+ };
17433
17524
  }): Bundle;
17434
17525
  };
17435
17526
  readonly requestStream: false;
@@ -41356,6 +41447,7 @@ declare namespace protos {
41356
41447
  DependencySpec,
41357
41448
  LinkedBundle,
41358
41449
  LinkedBundle_AssetsEntry,
41450
+ LinkedBundle_WebviewAssetsEntry,
41359
41451
  BuildInfo,
41360
41452
  BuildInfo_DependenciesEntry,
41361
41453
  RemoteLogPublisherClient,
@@ -41660,6 +41752,7 @@ declare namespace protos {
41660
41752
  Minify,
41661
41753
  Bundle,
41662
41754
  Bundle_AssetIdsEntry,
41755
+ Bundle_WebviewAssetIdsEntry,
41663
41756
  CompileParams,
41664
41757
  CompileLog,
41665
41758
  CompileLogLineDetail,
@@ -42927,7 +43020,7 @@ export declare class RedditAPIClient {
42927
43020
  * const user = await reddit.getUserById('t2_1qjpg');
42928
43021
  * ```
42929
43022
  */
42930
- getUserById(id: string): Promise<User>;
43023
+ getUserById(id: string): Promise<User | undefined>;
42931
43024
  getCollectionById(collectionId: string): Promise<PostCollection>;
42932
43025
  createCollection(options: CreateCollectionInput): Promise<PostCollection>;
42933
43026
  getCollectionsForSubreddit(subredditId: string): Promise<PostCollection[]>;
@@ -46830,6 +46923,9 @@ declare const ResolverDefinition: {
46830
46923
  assetIds?: {
46831
46924
  [x: string]: string | undefined;
46832
46925
  };
46926
+ webviewAssetIds?: {
46927
+ [x: string]: string | undefined;
46928
+ };
46833
46929
  } | undefined): Bundle;
46834
46930
  fromPartial(object: {
46835
46931
  code?: string;
@@ -46889,6 +46985,9 @@ declare const ResolverDefinition: {
46889
46985
  assetIds?: {
46890
46986
  [x: string]: string | undefined;
46891
46987
  };
46988
+ webviewAssetIds?: {
46989
+ [x: string]: string | undefined;
46990
+ };
46892
46991
  }): Bundle;
46893
46992
  };
46894
46993
  readonly requestStream: false;
@@ -47359,6 +47458,9 @@ declare const RuntimeActorDefinition: {
47359
47458
  assets?: {
47360
47459
  [x: string]: string | undefined;
47361
47460
  };
47461
+ webviewAssets?: {
47462
+ [x: string]: string | undefined;
47463
+ };
47362
47464
  } | undefined): LinkedBundle;
47363
47465
  fromPartial(object: {
47364
47466
  actor?: {
@@ -47392,6 +47494,9 @@ declare const RuntimeActorDefinition: {
47392
47494
  assets?: {
47393
47495
  [x: string]: string | undefined;
47394
47496
  };
47497
+ webviewAssets?: {
47498
+ [x: string]: string | undefined;
47499
+ };
47395
47500
  }): LinkedBundle;
47396
47501
  };
47397
47502
  readonly requestStream: false;
@@ -50698,6 +50803,9 @@ declare const SubredditMetadataResolverDefinition: {
50698
50803
  assets?: {
50699
50804
  [x: string]: string | undefined;
50700
50805
  };
50806
+ webviewAssets?: {
50807
+ [x: string]: string | undefined;
50808
+ };
50701
50809
  }[];
50702
50810
  contextActions?: {
50703
50811
  actorHostname?: string;
@@ -50771,6 +50879,9 @@ declare const SubredditMetadataResolverDefinition: {
50771
50879
  assets?: {
50772
50880
  [x: string]: string | undefined;
50773
50881
  };
50882
+ webviewAssets?: {
50883
+ [x: string]: string | undefined;
50884
+ };
50774
50885
  }[];
50775
50886
  contextActions?: {
50776
50887
  actorHostname?: string;
@@ -55698,6 +55809,9 @@ declare const SupervisorDefinition: {
55698
55809
  assets?: {
55699
55810
  [x: string]: string | undefined;
55700
55811
  };
55812
+ webviewAssets?: {
55813
+ [x: string]: string | undefined;
55814
+ };
55701
55815
  } | undefined): LinkedBundle;
55702
55816
  fromPartial(object: {
55703
55817
  actor?: {
@@ -55731,6 +55845,9 @@ declare const SupervisorDefinition: {
55731
55845
  assets?: {
55732
55846
  [x: string]: string | undefined;
55733
55847
  };
55848
+ webviewAssets?: {
55849
+ [x: string]: string | undefined;
55850
+ };
55734
55851
  }): LinkedBundle;
55735
55852
  };
55736
55853
  readonly requestStream: false;