@devvit/shared-types 0.12.2-next-2025-10-14-19-55-49-9af23873b.0 → 0.12.2-next-2025-10-14-20-12-24-67ef9681c.0

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.
@@ -1,12 +1,28 @@
1
1
  import type { BaseContext } from '../shared/baseContext.js';
2
- import type { T3 } from '../tid.js';
2
+ import type { T2, T3 } from '../tid.js';
3
3
  /**
4
4
  * Devvit web client context for the lifetime of the web view.
5
5
  */
6
6
  export type Context = BaseContext & {
7
+ /**
8
+ * The post author user ID, if applicable to the context and the account is
9
+ * active.
10
+ * @experimental
11
+ */
12
+ postAuthorId: T2 | undefined;
7
13
  /**
8
14
  * The ID of the current post.
9
15
  */
10
16
  postId: T3;
17
+ /**
18
+ * The current user's snoovtar URL if logged in.
19
+ * @experimental
20
+ */
21
+ snoovatar: string | undefined;
22
+ /**
23
+ * The current user's handle if logged in.
24
+ * @experimental
25
+ */
26
+ username: string | undefined;
11
27
  };
12
28
  //# sourceMappingURL=client-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-context.d.ts","sourceRoot":"","sources":["../../src/client/client-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;CACZ,CAAC"}
1
+ {"version":3,"file":"client-context.d.ts","sourceRoot":"","sources":["../../src/client/client-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAGlC;;;;OAIG;IACH,YAAY,EAAE,EAAE,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IAGX;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAG9B;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC"}
@@ -9,10 +9,13 @@ export type DevvitGlobal = {
9
9
  entrypoints: {
10
10
  [name: string]: string;
11
11
  };
12
+ /** App deep link data if any. */
12
13
  share: Share | undefined;
14
+ /** Data required for the "run as user" feature. */
13
15
  appPermissionState: AppPermissionState | undefined;
14
- /** @deprecated use `token`. */
15
- webbitToken: WebbitToken;
16
+ /** The auth bearer token shared across all entries. */
17
+ token: WebbitToken;
18
+ /** Current state of the web views immersive mode. */
16
19
  webViewMode: WebViewImmersiveMode | undefined;
17
20
  };
18
21
  /** App deep link data. */
@@ -1 +1 @@
1
- {"version":3,"file":"devvit-global.d.ts","sourceRoot":"","sources":["../../src/client/devvit-global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mEAAmE,CAAC;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0EAA0E,CAAC;AAErH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wCAAwC;AACxC,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAExC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IAEzB,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAEnD,+BAA+B;IAC/B,WAAW,EAAE,WAAW,CAAC;IAEzB,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,KAAK,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"devvit-global.d.ts","sourceRoot":"","sources":["../../src/client/devvit-global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mEAAmE,CAAC;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0EAA0E,CAAC;AAErH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wCAAwC;AACxC,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACxC,iCAAiC;IACjC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,mDAAmD;IACnD,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,uDAAuD;IACvD,KAAK,EAAE,WAAW,CAAC;IACnB,qDAAqD;IACrD,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,KAAK,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/shared-types",
3
- "version": "0.12.2-next-2025-10-14-19-55-49-9af23873b.0",
3
+ "version": "0.12.2-next-2025-10-14-20-12-24-67ef9681c.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "types": "./dist/index.d.ts",
35
35
  "dependencies": {
36
- "@devvit/protos": "0.12.2-next-2025-10-14-19-55-49-9af23873b.0",
36
+ "@devvit/protos": "0.12.2-next-2025-10-14-20-12-24-67ef9681c.0",
37
37
  "jsonschema": "1.4.1",
38
38
  "uuid": "9.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@devvit/repo-tools": "0.12.2-next-2025-10-14-19-55-49-9af23873b.0",
42
- "@devvit/tsconfig": "0.12.2-next-2025-10-14-19-55-49-9af23873b.0",
41
+ "@devvit/repo-tools": "0.12.2-next-2025-10-14-20-12-24-67ef9681c.0",
42
+ "@devvit/tsconfig": "0.12.2-next-2025-10-14-20-12-24-67ef9681c.0",
43
43
  "@types/redis-mock": "0.17.1",
44
44
  "@types/uuid": "9.0.0",
45
45
  "chokidar-cli": "3.0.0",
@@ -51,5 +51,5 @@
51
51
  "vitest": "1.6.1"
52
52
  },
53
53
  "source": "./src/index.ts",
54
- "gitHead": "7ee8f4f7331683dc2260a8f67e164e0fa520646d"
54
+ "gitHead": "81bedf6a85a518247bfca46615cbc1e3968a6f2b"
55
55
  }
@@ -2,26 +2,23 @@ import type { PostData } from '../PostData.js';
2
2
  import type { T2, T3, T5 } from '../tid.js';
3
3
  /** Client or server request context. */
4
4
  export type BaseContext = {
5
- /** The ID of the current subreddit */
5
+ /** The ID of the current subreddit. */
6
6
  subredditId: T5;
7
- /** The name of the current subreddit */
7
+ /** The name of the current subreddit. */
8
8
  subredditName: string;
9
- /** The current user's ID, if there is one; logged out users will be `undefined` */
9
+ /** The current user's ID, if logged in. */
10
10
  userId: T2 | undefined;
11
- /** The slug of the app that is running */
11
+ /** The slug of the app that is running. */
12
12
  appName: string;
13
- /** The version of the app that is running */
13
+ /** The version of the app that is running. */
14
14
  appVersion: string;
15
- /**
16
- * The ID of the current post, if applicable. If there's no post related to what
17
- * we're doing, this is `undefined`.
18
- */
15
+ /** The ID of the current post, if applicable to the context. */
19
16
  postId: T3 | undefined;
20
17
  /**
21
18
  * Post data included in the current post.
22
19
  * This data is set at custom Post creation via `submitPost({ postData: {...} })` and can be updated via `Post.setPostData({...})`.
23
20
  * If there is no post data specified, the value is undefined.
24
21
  */
25
- postData?: PostData | undefined;
22
+ postData: PostData | undefined;
26
23
  };
27
24
  //# sourceMappingURL=baseContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseContext.d.ts","sourceRoot":"","sources":["../../src/shared/baseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE5C,wCAAwC;AACxC,MAAM,MAAM,WAAW,GAAG;IACxB,sCAAsC;IACtC,WAAW,EAAE,EAAE,CAAC;IAChB,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CACjC,CAAC"}
1
+ {"version":3,"file":"baseContext.d.ts","sourceRoot":"","sources":["../../src/shared/baseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE5C,wCAAwC;AACxC,MAAM,MAAM,WAAW,GAAG;IACxB,uCAAuC;IACvC,WAAW,EAAE,EAAE,CAAC;IAChB,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,CAAC"}
package/webbit.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  /**
2
2
  * Signed Webbit user JWT (header, payload, signature base64 strings separated
3
3
  * by dots). Users shouldn't share their JWTs with others, but perfectly fine
4
- * for a given user to see. Named WebbitToken to match GQL's definition.
4
+ * for a given user to see.
5
5
  *
6
- * See `BridgeContext.webbitToken`.
6
+ * `BridgeContext.token` encodes a `RequestContext` and
7
+ * `BridgeContext.webbitToken` encodes a `WebbitClaims`.
7
8
  */
8
9
  export type WebbitToken = `${string}.${string}.${string}`;
9
10
  export declare const noWebbitToken: WebbitToken;
11
+ /**
12
+ * `RequestContext` token query parameter name on `DevvitPost.entrypointUrl`.
13
+ */
14
+ export declare const tokenParam: string;
10
15
  //# sourceMappingURL=webbit.d.ts.map
package/webbit.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"webbit.d.ts","sourceRoot":"","sources":["../src/webbit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAC1D,eAAO,MAAM,aAAa,EAAE,WAAqB,CAAC"}
1
+ {"version":3,"file":"webbit.d.ts","sourceRoot":"","sources":["../src/webbit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAC1D,eAAO,MAAM,aAAa,EAAE,WAAqB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAgB,CAAC"}
package/webbit.js CHANGED
@@ -1 +1,5 @@
1
1
  export const noWebbitToken = `0.0.0`;
2
+ /**
3
+ * `RequestContext` token query parameter name on `DevvitPost.entrypointUrl`.
4
+ */
5
+ export const tokenParam = 'token';