@devvit/public-api 0.10.21-next-2024-05-20-724913735.0 → 0.10.21-next-2024-05-20-31c943973.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,7 +95,7 @@ export class BlocksHandler {
95
95
  }
96
96
  async handle(request, metadata) {
97
97
  const context = new RenderContext(request);
98
- const devvitContext = __classPrivateFieldGet(this, _BlocksHandler_contextBuilder, "f").buildContext(context, request.env ?? {}, metadata);
98
+ const devvitContext = __classPrivateFieldGet(this, _BlocksHandler_contextBuilder, "f").buildContext(context, request, metadata);
99
99
  context.devvitContext = devvitContext;
100
100
  let blocks;
101
101
  /**
@@ -1,7 +1,7 @@
1
- import type { Metadata, UIEnvironment } from '@devvit/protos';
1
+ import type { Metadata, UIRequest } from '@devvit/protos';
2
2
  import { Devvit } from '../../../Devvit.js';
3
3
  import type { RenderContext } from './RenderContext.js';
4
4
  export declare class ContextBuilder {
5
- buildContext(renderContext: RenderContext, env: UIEnvironment, metadata: Metadata): Devvit.Context;
5
+ buildContext(renderContext: RenderContext, request: UIRequest, metadata: Metadata): Devvit.Context;
6
6
  }
7
7
  //# sourceMappingURL=ContextBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/ContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAe5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAaxD,qBAAa,cAAc;IAClB,YAAY,CACjB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAAC,OAAO;CAmClB"}
1
+ {"version":3,"file":"ContextBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/ContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAe5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAaxD,qBAAa,cAAc;IAClB,YAAY,CACjB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAAC,OAAO;CAuClB"}
@@ -20,7 +20,7 @@ const UnimplementedProxy = new Proxy({}, {
20
20
  },
21
21
  });
22
22
  export class ContextBuilder {
23
- buildContext(renderContext, env, metadata) {
23
+ buildContext(renderContext, request, metadata) {
24
24
  const modLog = new ModLogClient(metadata);
25
25
  const kvStore = new KeyValueStorage(metadata);
26
26
  const redis = new RedisClient(metadata);
@@ -49,9 +49,12 @@ export class ContextBuilder {
49
49
  useInterval,
50
50
  useForm,
51
51
  cache,
52
- dimensions: env?.dimensions,
52
+ dimensions: request.env?.dimensions,
53
53
  };
54
- const baseContext = getContextFromMetadata(metadata);
54
+ // TODO: Would commentId ever be needed for the blocks handler context?
55
+ // You'd want something like....
56
+ // const baseContext = getContextFromMetadata(metadata, request.props?.postId, request.props?.commentId);
57
+ const baseContext = getContextFromMetadata(metadata, request.props?.postId);
55
58
  baseContext.debug.effects = renderContext;
56
59
  return { ...baseContext, ...apiClients };
57
60
  }
package/meta.json CHANGED
@@ -9717,7 +9717,7 @@
9717
9717
  "format": "esm"
9718
9718
  },
9719
9719
  "../protos/dist/types/devvit/plugin/redditapi/wiki/wiki_svc.js": {
9720
- "bytes": 8865,
9720
+ "bytes": 30154,
9721
9721
  "imports": [
9722
9722
  {
9723
9723
  "path": "../../node_modules/protobufjs/minimal.js",
@@ -9811,7 +9811,7 @@
9811
9811
  "format": "esm"
9812
9812
  },
9813
9813
  "../protos/dist/types/devvit/plugin/redditapi/users/users_svc.js": {
9814
- "bytes": 9796,
9814
+ "bytes": 11511,
9815
9815
  "imports": [
9816
9816
  {
9817
9817
  "path": "../../node_modules/protobufjs/minimal.js",
@@ -12638,7 +12638,7 @@
12638
12638
  "format": "esm"
12639
12639
  },
12640
12640
  "src/devvit/internals/blocks/handler/ContextBuilder.ts": {
12641
- "bytes": 2613,
12641
+ "bytes": 2864,
12642
12642
  "imports": [
12643
12643
  {
12644
12644
  "path": "src/devvit/Devvit.ts",
@@ -12719,7 +12719,7 @@
12719
12719
  "format": "esm"
12720
12720
  },
12721
12721
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
12722
- "bytes": 14690,
12722
+ "bytes": 14680,
12723
12723
  "imports": [
12724
12724
  {
12725
12725
  "path": "@devvit/protos",
@@ -14403,7 +14403,7 @@
14403
14403
  "bytesInOutput": 11633
14404
14404
  },
14405
14405
  "../protos/dist/types/devvit/plugin/redditapi/wiki/wiki_svc.js": {
14406
- "bytesInOutput": 4091
14406
+ "bytesInOutput": 17680
14407
14407
  },
14408
14408
  "../protos/dist/types/devvit/plugin/redditapi/wiki/wiki_msg.js": {
14409
14409
  "bytesInOutput": 57699
@@ -14415,7 +14415,7 @@
14415
14415
  "bytesInOutput": 191666
14416
14416
  },
14417
14417
  "../protos/dist/types/devvit/plugin/redditapi/users/users_svc.js": {
14418
- "bytesInOutput": 4003
14418
+ "bytesInOutput": 5098
14419
14419
  },
14420
14420
  "../protos/dist/types/devvit/plugin/redditapi/users/users_msg.js": {
14421
14421
  "bytesInOutput": 68275
@@ -14670,10 +14670,10 @@
14670
14670
  "bytesInOutput": 2049
14671
14671
  },
14672
14672
  "src/devvit/internals/blocks/handler/ContextBuilder.ts": {
14673
- "bytesInOutput": 1372
14673
+ "bytesInOutput": 1407
14674
14674
  },
14675
14675
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
14676
- "bytesInOutput": 12262
14676
+ "bytesInOutput": 12252
14677
14677
  },
14678
14678
  "src/devvit/internals/ui-request-handler.ts": {
14679
14679
  "bytesInOutput": 618
@@ -14760,7 +14760,7 @@
14760
14760
  "bytesInOutput": 2583
14761
14761
  }
14762
14762
  },
14763
- "bytes": 14802884
14763
+ "bytes": 14860321
14764
14764
  }
14765
14765
  }
14766
14766
  }
package/meta.min.json CHANGED
@@ -3585,7 +3585,7 @@
3585
3585
  "format": "esm"
3586
3586
  },
3587
3587
  "src/devvit/internals/blocks/handler/ContextBuilder.ts": {
3588
- "bytes": 2613,
3588
+ "bytes": 2864,
3589
3589
  "imports": [
3590
3590
  {
3591
3591
  "path": "src/devvit/Devvit.ts",
@@ -3666,7 +3666,7 @@
3666
3666
  "format": "esm"
3667
3667
  },
3668
3668
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
3669
- "bytes": 14690,
3669
+ "bytes": 14680,
3670
3670
  "imports": [
3671
3671
  {
3672
3672
  "path": "@devvit/protos",
@@ -4577,7 +4577,7 @@
4577
4577
  "imports": [],
4578
4578
  "exports": [],
4579
4579
  "inputs": {},
4580
- "bytes": 1117182
4580
+ "bytes": 1117437
4581
4581
  },
4582
4582
  "dist/public-api.min.js": {
4583
4583
  "imports": [
@@ -5267,10 +5267,10 @@
5267
5267
  "bytesInOutput": 422
5268
5268
  },
5269
5269
  "src/devvit/internals/blocks/handler/ContextBuilder.ts": {
5270
- "bytesInOutput": 496
5270
+ "bytesInOutput": 516
5271
5271
  },
5272
5272
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
5273
- "bytesInOutput": 5233
5273
+ "bytesInOutput": 5225
5274
5274
  },
5275
5275
  "src/apis/reddit/helpers/makeGettersEnumerable.ts": {
5276
5276
  "bytesInOutput": 166
@@ -5351,7 +5351,7 @@
5351
5351
  "bytesInOutput": 1190
5352
5352
  }
5353
5353
  },
5354
- "bytes": 236916
5354
+ "bytes": 236928
5355
5355
  }
5356
5356
  }
5357
5357
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/public-api",
3
- "version": "0.10.21-next-2024-05-20-724913735.0",
3
+ "version": "0.10.21-next-2024-05-20-31c943973.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "types": "./index.d.ts",
32
32
  "dependencies": {
33
- "@devvit/protos": "0.10.21-next-2024-05-20-724913735.0",
34
- "@devvit/shared-types": "0.10.21-next-2024-05-20-724913735.0",
33
+ "@devvit/protos": "0.10.21-next-2024-05-20-31c943973.0",
34
+ "@devvit/shared-types": "0.10.21-next-2024-05-20-31c943973.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.20",
43
43
  "@devvit/repo-tools": "0.10.20",
44
- "@devvit/tsconfig": "0.10.21-next-2024-05-20-724913735.0",
44
+ "@devvit/tsconfig": "0.10.21-next-2024-05-20-31c943973.0",
45
45
  "@microsoft/api-extractor": "7.41.0",
46
46
  "@reddit/faceplate-ui": "11.1.0",
47
47
  "@types/clone-deep": "4.0.1",
@@ -64,5 +64,5 @@
64
64
  }
65
65
  },
66
66
  "source": "./src/index.ts",
67
- "gitHead": "c026fbb0a3522c2fe497b228444922c10935ade6"
67
+ "gitHead": "5778aa55a689ab5f474c414c967bcdd84a24eef5"
68
68
  }
package/public-api.d.ts CHANGED
@@ -67702,7 +67702,11 @@ declare const UsersDefinition: {
67702
67702
  }): UserDataByAccountIdsResponse;
67703
67703
  };
67704
67704
  readonly responseStream: false;
67705
- readonly options: {};
67705
+ readonly options: {
67706
+ readonly _unknownFields: {
67707
+ readonly 480010: readonly [Uint8Array];
67708
+ };
67709
+ };
67706
67710
  };
67707
67711
  /** https://www.reddit.com/dev/api#GET_api_username_available */
67708
67712
  readonly usernameAvailable: {
@@ -71724,7 +71728,11 @@ declare const WikiDefinition: {
71724
71728
  }): GetWikiPagesResponse;
71725
71729
  };
71726
71730
  readonly responseStream: false;
71727
- readonly options: {};
71731
+ readonly options: {
71732
+ readonly _unknownFields: {
71733
+ readonly 480010: readonly [Uint8Array];
71734
+ };
71735
+ };
71728
71736
  };
71729
71737
  /**
71730
71738
  * Get a wiki page
@@ -71753,6 +71761,11 @@ declare const WikiDefinition: {
71753
71761
  $type: "devvit.plugin.redditapi.wiki.GetWikiPageResponse";
71754
71762
  encode(message: GetWikiPageResponse, writer?: _m0.Writer): _m0.Writer;
71755
71763
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GetWikiPageResponse;
71764
+ /**
71765
+ * Retrieve the current permission settings for page
71766
+ *
71767
+ * @see {@link https://www.reddit.com/dev/api#GET_wiki_settings_\{page\}}
71768
+ */
71756
71769
  fromJSON(object: any): GetWikiPageResponse;
71757
71770
  toJSON(message: GetWikiPageResponse): unknown;
71758
71771
  create(base?: {
@@ -72281,7 +72294,11 @@ declare const WikiDefinition: {
72281
72294
  }): GetWikiPageResponse;
72282
72295
  };
72283
72296
  readonly responseStream: false;
72284
- readonly options: {};
72297
+ readonly options: {
72298
+ readonly _unknownFields: {
72299
+ readonly 480010: readonly [Uint8Array];
72300
+ };
72301
+ };
72285
72302
  };
72286
72303
  /**
72287
72304
  * Edit wiki page
@@ -72324,7 +72341,11 @@ declare const WikiDefinition: {
72324
72341
  fromPartial(_: {}): Empty;
72325
72342
  };
72326
72343
  readonly responseStream: false;
72327
- readonly options: {};
72344
+ readonly options: {
72345
+ readonly _unknownFields: {
72346
+ readonly 480010: readonly [Uint8Array];
72347
+ };
72348
+ };
72328
72349
  };
72329
72350
  /**
72330
72351
  * Hide a wiki page revision
@@ -72365,7 +72386,11 @@ declare const WikiDefinition: {
72365
72386
  }): HideWikiPageRevisionResponse;
72366
72387
  };
72367
72388
  readonly responseStream: false;
72368
- readonly options: {};
72389
+ readonly options: {
72390
+ readonly _unknownFields: {
72391
+ readonly 480010: readonly [Uint8Array];
72392
+ };
72393
+ };
72369
72394
  };
72370
72395
  /**
72371
72396
  * Get a list of revisions of a wiki page
@@ -72942,7 +72967,11 @@ declare const WikiDefinition: {
72942
72967
  }): WikiPageRevisionListing;
72943
72968
  };
72944
72969
  readonly responseStream: false;
72945
- readonly options: {};
72970
+ readonly options: {
72971
+ readonly _unknownFields: {
72972
+ readonly 480010: readonly [Uint8Array];
72973
+ };
72974
+ };
72946
72975
  };
72947
72976
  /**
72948
72977
  * Retrieve a list of recently changed wiki pages in this subreddit
@@ -73517,7 +73546,11 @@ declare const WikiDefinition: {
73517
73546
  }): WikiPageRevisionListing;
73518
73547
  };
73519
73548
  readonly responseStream: false;
73520
- readonly options: {};
73549
+ readonly options: {
73550
+ readonly _unknownFields: {
73551
+ readonly 480010: readonly [Uint8Array];
73552
+ };
73553
+ };
73521
73554
  };
73522
73555
  /**
73523
73556
  * Revert a wiki page to revision
@@ -73558,7 +73591,11 @@ declare const WikiDefinition: {
73558
73591
  fromPartial(_: {}): Empty;
73559
73592
  };
73560
73593
  readonly responseStream: false;
73561
- readonly options: {};
73594
+ readonly options: {
73595
+ readonly _unknownFields: {
73596
+ readonly 480010: readonly [Uint8Array];
73597
+ };
73598
+ };
73562
73599
  };
73563
73600
  /**
73564
73601
  * Retrieve the current permission settings for page
@@ -74107,7 +74144,11 @@ declare const WikiDefinition: {
74107
74144
  }): WikiPageSettings_2;
74108
74145
  };
74109
74146
  readonly responseStream: false;
74110
- readonly options: {};
74147
+ readonly options: {
74148
+ readonly _unknownFields: {
74149
+ readonly 480010: readonly [Uint8Array];
74150
+ };
74151
+ };
74111
74152
  };
74112
74153
  /**
74113
74154
  * Update the permissions and visibility of wiki page
@@ -74660,7 +74701,11 @@ declare const WikiDefinition: {
74660
74701
  }): WikiPageSettings_2;
74661
74702
  };
74662
74703
  readonly responseStream: false;
74663
- readonly options: {};
74704
+ readonly options: {
74705
+ readonly _unknownFields: {
74706
+ readonly 480010: readonly [Uint8Array];
74707
+ };
74708
+ };
74664
74709
  };
74665
74710
  /**
74666
74711
  * Allow/deny username to edit this wiki page
@@ -74704,7 +74749,11 @@ declare const WikiDefinition: {
74704
74749
  fromPartial(_: {}): Empty;
74705
74750
  };
74706
74751
  readonly responseStream: false;
74707
- readonly options: {};
74752
+ readonly options: {
74753
+ readonly _unknownFields: {
74754
+ readonly 480010: readonly [Uint8Array];
74755
+ };
74756
+ };
74708
74757
  };
74709
74758
  };
74710
74759
  };