@devvit/web-view-scripts 0.12.2-next-2025-10-15-23-34-15-434bad048.0 → 0.12.2-next-2025-10-16-22-18-10-63705be33.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/web-view-scripts",
3
- "version": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
3
+ "version": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "types": "./dist/index.d.ts",
36
36
  "dependencies": {
37
- "@devvit/protos": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
38
- "@devvit/shared": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
39
- "@devvit/shared-types": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
37
+ "@devvit/protos": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
38
+ "@devvit/shared": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
39
+ "@devvit/shared-types": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
40
40
  "jwt-decode": "4.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@ampproject/filesize": "4.3.0",
44
- "@devvit/repo-tools": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
45
- "@devvit/tsconfig": "0.12.2-next-2025-10-15-23-34-15-434bad048.0",
44
+ "@devvit/repo-tools": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
45
+ "@devvit/tsconfig": "0.12.2-next-2025-10-16-22-18-10-63705be33.0",
46
46
  "esbuild": "0.25.9",
47
47
  "eslint": "9.11.1",
48
48
  "typescript": "5.8.3",
@@ -55,5 +55,5 @@
55
55
  }
56
56
  },
57
57
  "source": "./src/index.ts",
58
- "gitHead": "b5e5f958bb02a48561a327735921f4971beedd67"
58
+ "gitHead": "b10832dd23c6927c749ac348beea50a3743f0f88"
59
59
  }
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var o={hash:"434bad0",version:"0.12.2-dev"};var c;(function(t){t[t.CLIENT=0]="CLIENT",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"})(c||(c={}));function v(){addEventListener("load",()=>{let t=performance.timeOrigin,e=performance.now(),n=performance.timeOrigin+e;m({scope:c.CLIENT,type:"devvit-internal",analytics:{event:"web-view-loaded",timeStart:t,timeEnd:n,duration:e}})}),document.addEventListener("pointerdown",()=>{m({scope:c.CLIENT,type:"devvit-internal",analytics:{event:"click"}})},{passive:!0})}function m(t){parent.postMessage(t,"*")}function d(t,e){if(!t)throw Error(e)}var s;(function(t){t.COMMENT="t1_",t.ACCOUNT="t2_",t.LINK="t3_",t.MESSAGE="t4_",t.SUBREDDIT="t5_",t.AWARD="t6_"})(s||(s={}));function D(t){return t.startsWith(s.ACCOUNT)}function C(t){return t.startsWith(s.LINK)}function R(t){return t.startsWith(s.SUBREDDIT)}function S(t){d(D(t),`Expected account id to start with ${s.ACCOUNT}, got ${t}}`)}function I(t){d(C(t),`Expected link id to start with ${s.LINK}, got ${t}}`)}function N(t){d(R(t),`Expected subreddit id to start with ${s.SUBREDDIT}, got ${t}}`)}function u(t){return S(t),t}function f(t){return I(t),t}function l(t){return N(t),t}var h="clientVersion";function x(t){if(t.currentScript&&"src"in t.currentScript)return new URL(t.currentScript.src).searchParams.get(h)??void 0}var p=class extends Error{};p.prototype.name="InvalidTokenError";function V(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function W(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return V(e)}catch{return atob(e)}}function b(t,e){if(typeof t!="string")throw new p("Invalid token specified: must be a string");e||(e={});let n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new p(`Invalid token specified: missing part #${n+1}`);let a;try{a=W(r)}catch(i){throw new p(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new p(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}function g(t){if(t)try{return b(t)?.devvit}catch(e){throw Error("token decode failure",{cause:e})}}var w=(t,e,n)=>{let r=A(n.name,e.hash),a=g(r.signedRequestContext),i;if(a?i=$(a,r.postData):r.webViewContext&&(i=k(r.webViewContext,r.postData)),!i)throw Error("no context");let T=r.webViewClientData;globalThis.devvit={context:i,dependencies:{client:x(t),webViewScripts:o},entrypoints:T?.appConfig?.entrypoints??{},share:r?.shareParam?{userData:r?.shareParam.userData}:void 0,appPermissionState:r?.appPermissionState,token:r.webbitToken||r.signedRequestContext,webViewMode:r?.viewMode}};function $(t,e){if(!t.app)throw Error("no RequestContext.app");if(!t.post)throw Error("no RequestContext.post");if(!t.subreddit)throw Error("no RequestContext.subreddit");return{appName:t.app.name,appVersion:t.app.version,postAuthorId:u(t.post.author),postData:e?.developerData,postId:f(t.post.id),snoovatar:t.user?.snoovatar,subredditId:l(t.subreddit.id),subredditName:t.subreddit.name,userId:t.user?.id?u(t.user.id):void 0,username:t.user?.name}}function k(t,e){return{appName:t.appName,appVersion:t.appVersion,postData:e?.developerData,postAuthorId:void 0,postId:f(t.postId),snoovatar:void 0,subredditId:l(t.subredditId),subredditName:t.subredditName,userId:t.userId?u(t.userId):void 0,username:void 0}}function A(t,e){if(t)return JSON.parse(t);let n=e?.slice(1);if(!n)throw Error("no bridge context");return JSON.parse(decodeURIComponent(n))}async function y(t,e,n,r,a){let i=new Request(r,a);return U(n,new URL(i.url))&&i.headers.set("Authorization",`Bearer ${t}`),await e(i)}function U(t,e){return e.origin===t.origin}w(document,location,window);v();globalThis.fetch=y.bind(void 0,devvit.token,globalThis.fetch,location);})();
1
+ "use strict";(()=>{var o={hash:"63705be",version:"0.12.2-dev"};var c;(function(t){t[t.CLIENT=0]="CLIENT",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"})(c||(c={}));function v(){addEventListener("load",()=>{let t=performance.timeOrigin,e=performance.now(),n=performance.timeOrigin+e;m({scope:c.CLIENT,type:"devvit-internal",analytics:{event:"web-view-loaded",timeStart:t,timeEnd:n,duration:e}})}),document.addEventListener("pointerdown",()=>{m({scope:c.CLIENT,type:"devvit-internal",analytics:{event:"click"}})},{passive:!0})}function m(t){parent.postMessage(t,"*")}function d(t,e){if(!t)throw Error(e)}var s;(function(t){t.COMMENT="t1_",t.ACCOUNT="t2_",t.LINK="t3_",t.MESSAGE="t4_",t.SUBREDDIT="t5_",t.AWARD="t6_"})(s||(s={}));function D(t){return t.startsWith(s.ACCOUNT)}function C(t){return t.startsWith(s.LINK)}function R(t){return t.startsWith(s.SUBREDDIT)}function S(t){d(D(t),`Expected account id to start with ${s.ACCOUNT}, got ${t}}`)}function I(t){d(C(t),`Expected link id to start with ${s.LINK}, got ${t}}`)}function N(t){d(R(t),`Expected subreddit id to start with ${s.SUBREDDIT}, got ${t}}`)}function u(t){return S(t),t}function f(t){return I(t),t}function l(t){return N(t),t}var h="clientVersion";function x(t){if(t.currentScript&&"src"in t.currentScript)return new URL(t.currentScript.src).searchParams.get(h)??void 0}var p=class extends Error{};p.prototype.name="InvalidTokenError";function V(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function W(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return V(e)}catch{return atob(e)}}function b(t,e){if(typeof t!="string")throw new p("Invalid token specified: must be a string");e||(e={});let n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new p(`Invalid token specified: missing part #${n+1}`);let a;try{a=W(r)}catch(i){throw new p(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new p(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}function g(t){if(t)try{return b(t)?.devvit}catch(e){throw Error("token decode failure",{cause:e})}}var w=(t,e,n)=>{let r=A(n.name,e.hash),a=g(r.signedRequestContext),i;if(a?i=$(a,r.postData):r.webViewContext&&(i=k(r.webViewContext,r.postData)),!i)throw Error("no context");let T=r.webViewClientData;globalThis.devvit={context:i,dependencies:{client:x(t),webViewScripts:o},entrypoints:T?.appConfig?.entrypoints??{},share:r?.shareParam?{userData:r?.shareParam.userData}:void 0,appPermissionState:r?.appPermissionState,token:r.webbitToken||r.signedRequestContext,webViewMode:r?.viewMode}};function $(t,e){if(!t.app)throw Error("no RequestContext.app");if(!t.post)throw Error("no RequestContext.post");if(!t.subreddit)throw Error("no RequestContext.subreddit");return{appName:t.app.name,appVersion:t.app.version,postAuthorId:u(t.post.author),postData:e?.developerData,postId:f(t.post.id),snoovatar:t.user?.snoovatar,subredditId:l(t.subreddit.id),subredditName:t.subreddit.name,userId:t.user?.id?u(t.user.id):void 0,username:t.user?.name}}function k(t,e){return{appName:t.appName,appVersion:t.appVersion,postData:e?.developerData,postAuthorId:void 0,postId:f(t.postId),snoovatar:void 0,subredditId:l(t.subredditId),subredditName:t.subredditName,userId:t.userId?u(t.userId):void 0,username:void 0}}function A(t,e){if(t)return JSON.parse(t);let n=e?.slice(1);if(!n)throw Error("no bridge context");return JSON.parse(decodeURIComponent(n))}async function y(t,e,n,r,a){let i=new Request(r,a);return U(n,new URL(i.url))&&i.headers.set("Authorization",`Bearer ${t}`),await e(i)}function U(t,e){return e.origin===t.origin}w(document,location,window);v();globalThis.fetch=y.bind(void 0,devvit.token,globalThis.fetch,location);})();
2
2
  //# sourceMappingURL=devvit.v1.min.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["<define:globalThis.webViewScriptsVersion>", "../../../protos/dist/json/devvit/ui/effects/web_view/v1alpha/post_message.js", "../../src/analytics.ts", "../../../shared-types/dist/assert.js", "../../../shared-types/dist/tid.js", "../../../shared-types/dist/web-view-scripts-constants.js", "../../src/client.ts", "../../../../node_modules/jwt-decode/build/esm/index.js", "../../src/token.ts", "../../src/devvit-global.ts", "../../src/fetch.ts", "../../src/devvit.v1.ts"],
4
- "sourcesContent": ["{\"hash\":\"434bad0\",\"version\":\"0.12.2-dev\"}", "/**\n * #post_message.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var WebViewInternalMessageScope;\n(function (WebViewInternalMessageScope) {\n /** CLIENT - Message is intended for the client only */\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"CLIENT\"] = 0] = \"CLIENT\";\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(WebViewInternalMessageScope || (WebViewInternalMessageScope = {}));\n", "import {\n type WebViewInternalMessage,\n WebViewInternalMessageScope,\n} from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js';\n\n/**\n * initAnalytics is added to all Devvit apps which use web views.\n *\n * This sends interaction events to the parent window via postMessage.\n * These metrics are used to inform app performance and feed ranking.\n */\nexport function initAnalytics(): void {\n addEventListener('load', () => {\n const timeStart = performance.timeOrigin;\n const duration = performance.now();\n const timeEnd = performance.timeOrigin + duration;\n\n // to-do: support devvit.debug.\n // if (devvit.debug.analytics) console.debug(`[analytics] loaded in ${duration} ms`);\n postWebViewInternalMessage({\n scope: WebViewInternalMessageScope.CLIENT,\n type: 'devvit-internal',\n analytics: { event: 'web-view-loaded', timeStart, timeEnd, duration },\n });\n });\n\n document.addEventListener(\n 'pointerdown',\n () => {\n postWebViewInternalMessage({\n scope: WebViewInternalMessageScope.CLIENT,\n type: 'devvit-internal',\n analytics: { event: 'click' },\n });\n },\n { passive: true }\n );\n}\n\nfunction postWebViewInternalMessage(internalMessage: WebViewInternalMessage): void {\n parent.postMessage(internalMessage, '*');\n}\n", "export function assert(condition, msg) {\n if (!condition)\n throw Error(msg);\n}\n", "import { assert } from './assert.js';\n// CALMS!\nexport var T_PREFIX;\n(function (T_PREFIX) {\n T_PREFIX[\"COMMENT\"] = \"t1_\";\n T_PREFIX[\"ACCOUNT\"] = \"t2_\";\n T_PREFIX[\"LINK\"] = \"t3_\";\n T_PREFIX[\"MESSAGE\"] = \"t4_\";\n T_PREFIX[\"SUBREDDIT\"] = \"t5_\";\n T_PREFIX[\"AWARD\"] = \"t6_\";\n})(T_PREFIX || (T_PREFIX = {}));\n// type guards\nexport function isT1(id) {\n return id.startsWith(T_PREFIX.COMMENT);\n}\nexport function isT2(id) {\n return id.startsWith(T_PREFIX.ACCOUNT);\n}\nexport function isT3(id) {\n return id.startsWith(T_PREFIX.LINK);\n}\nexport function isT4(id) {\n return id.startsWith(T_PREFIX.MESSAGE);\n}\nexport function isT5(id) {\n return id.startsWith(T_PREFIX.SUBREDDIT);\n}\nexport function isT6(id) {\n return id.startsWith(T_PREFIX.AWARD);\n}\n// assertion functions\nexport function assertT1(id) {\n assert(isT1(id), `Expected comment id to start with ${T_PREFIX.COMMENT}, got ${id}}`);\n}\nexport function assertT2(id) {\n assert(isT2(id), `Expected account id to start with ${T_PREFIX.ACCOUNT}, got ${id}}`);\n}\nexport function assertT3(id) {\n assert(isT3(id), `Expected link id to start with ${T_PREFIX.LINK}, got ${id}}`);\n}\nexport function assertT4(id) {\n assert(isT4(id), `Expected message id to start with ${T_PREFIX.MESSAGE}, got ${id}}`);\n}\nexport function assertT5(id) {\n assert(isT5(id), `Expected subreddit id to start with ${T_PREFIX.SUBREDDIT}, got ${id}}`);\n}\nexport function assertT6(id) {\n assert(isT6(id), `Expected award id to start with ${T_PREFIX.AWARD}, got ${id}}`);\n}\n// factory functions\nexport function T1(id) {\n assertT1(id);\n return id;\n}\nexport function T2(id) {\n assertT2(id);\n return id;\n}\nexport function T3(id) {\n assertT3(id);\n return id;\n}\nexport function T4(id) {\n assertT4(id);\n return id;\n}\nexport function T5(id) {\n assertT5(id);\n return id;\n}\nexport function T6(id) {\n assertT6(id);\n return id;\n}\nexport function asTid(id) {\n if (isT1(id)) {\n return T1(id);\n }\n if (isT2(id)) {\n return T2(id);\n }\n if (isT3(id)) {\n return T3(id);\n }\n if (isT4(id)) {\n return T4(id);\n }\n if (isT5(id)) {\n return T5(id);\n }\n if (isT6(id)) {\n return T6(id);\n }\n throw new Error(`Expected thing id to start with ${Object.values(T_PREFIX).join(', ')} got ${id}}`);\n}\n", "/**\n * The `@devvit/client` version query parameter name the web view's document\n * script tag:\n *\n * <script src=\"https://webview.devvit.net/scripts/devvit.v1.min.js?clientVersion=1.2.3\"></script>\n *\n * The value is the version of `@devvit/client` bundled with the app.\n * `@devvit/client` may have runtime dependencies on\n * `@devvit/web-view-scripts` (`devvit.v1.min.js`) which is not bundled. The\n * client version can be used to specialize behavior to match the static\n * expectations of the `@devvit/client` version.\n */\nexport const clientVersionQueryParam = 'clientVersion';\n", "import { clientVersionQueryParam } from '@devvit/shared-types/web-view-scripts-constants.js';\n\n/**\n * Queries the client version (eg, `'1.2.3'`) from the iframe document's script\n * tag:\n *\n * <script src=\"https://webview.devvit.net/scripts/devvit.v1.min.js?clientVersion=1.2.3\"></script>\n *\n * See `clientVersionQueryParam`.\n */\nexport function queryClientVersion(document: {\n readonly currentScript: { readonly src: string } | SVGScriptElement | null;\n}): string | undefined {\n if (document.currentScript && 'src' in document.currentScript)\n return (\n new URL(document.currentScript.src).searchParams.get(clientVersionQueryParam) ?? undefined\n );\n}\n", "export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n", "import type { RequestContext } from '@devvit/protos/json/devvit/platform/request_context.js';\nimport { jwtDecode } from 'jwt-decode';\n\n// to-do: make a Protobuf for ContextClaims.\nexport type ContextClaims = { devvit: RequestContext };\n\nexport function decodeToken(token: string | undefined): RequestContext | undefined {\n if (!token) return;\n\n try {\n return jwtDecode<ContextClaims>(token)?.devvit;\n } catch (err) {\n throw Error('token decode failure', { cause: err });\n }\n}\n", "import type { DevvitPostData } from '@devvit/protos';\nimport type { RequestContext } from '@devvit/protos/json/devvit/platform/request_context.js';\nimport type {\n BridgeContext,\n WebViewClientData,\n WebViewContext,\n} from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';\nimport type { Context } from '@devvit/shared-types/client/client-context.js';\nimport type {\n DevvitGlobal,\n WebViewScriptsVersion,\n} from '@devvit/shared-types/client/devvit-global.js';\nimport { T2, T3, T5 } from '@devvit/shared-types/tid.js';\nimport { type WebbitToken } from '@devvit/shared-types/webbit.js';\n\nimport { queryClientVersion } from './client.js';\nimport { decodeToken } from './token.js';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var devvit: DevvitGlobal;\n /** Defined by build.js. */\n // eslint-disable-next-line no-var\n var webViewScriptsVersion: Readonly<WebViewScriptsVersion>;\n}\n\n/** @internal */\nexport const initDevvitGlobal = (\n document: { readonly currentScript: { readonly src: string } | SVGScriptElement | null },\n location: { readonly hash: string },\n window: { readonly name: string }\n): void => {\n const bridge = getBridgeContext(window.name, location.hash);\n\n const reqCtx = decodeToken(bridge.signedRequestContext);\n\n let context;\n if (reqCtx) context = contextFromRequestContext(reqCtx, bridge.postData);\n else if (bridge.webViewContext)\n context = contextFromWebViewContext(bridge.webViewContext, bridge.postData);\n if (!context) throw Error('no context');\n\n // to-do: expose `BridgeContext.client`, `devvitDebug`,\n // `nativeVersion` / `shredditVersion`.\n\n const clientData: WebViewClientData | undefined = bridge.webViewClientData;\n globalThis.devvit = {\n context,\n dependencies: {\n client: queryClientVersion(document),\n webViewScripts: globalThis.webViewScriptsVersion,\n },\n entrypoints: clientData?.appConfig?.entrypoints ?? {},\n share: bridge?.shareParam ? { userData: bridge?.shareParam.userData } : undefined,\n appPermissionState: bridge?.appPermissionState,\n // to-do: prefer signed request context once understood by backend.\n token: (bridge.webbitToken || bridge.signedRequestContext) as WebbitToken,\n webViewMode: bridge?.viewMode,\n };\n};\n\n/** @internal */\nexport function contextFromRequestContext(\n reqCtx: Readonly<RequestContext>,\n postData: Readonly<DevvitPostData> | undefined\n): Context {\n if (!reqCtx.app) throw Error('no RequestContext.app');\n if (!reqCtx.post) throw Error('no RequestContext.post');\n if (!reqCtx.subreddit) throw Error('no RequestContext.subreddit');\n return {\n appName: reqCtx.app.name,\n appVersion: reqCtx.app.version,\n postAuthorId: T2(reqCtx.post.author),\n postData: postData?.developerData,\n postId: T3(reqCtx.post.id),\n snoovatar: reqCtx.user?.snoovatar,\n subredditId: T5(reqCtx.subreddit.id),\n subredditName: reqCtx.subreddit.name,\n userId: reqCtx.user?.id ? T2(reqCtx.user.id) : undefined,\n username: reqCtx.user?.name,\n };\n}\n\n/** @internal */\nexport function contextFromWebViewContext(\n webViewCtx: Readonly<WebViewContext>,\n postData: Readonly<DevvitPostData> | undefined\n): Context {\n return {\n appName: webViewCtx.appName,\n appVersion: webViewCtx.appVersion,\n postData: postData?.developerData,\n postAuthorId: undefined,\n postId: T3(webViewCtx.postId),\n snoovatar: undefined,\n subredditId: T5(webViewCtx.subredditId),\n subredditName: webViewCtx.subredditName,\n userId: webViewCtx.userId ? T2(webViewCtx.userId) : undefined,\n username: undefined,\n };\n}\n\n/**\n * Extracts the BridgeContext from the hash.\n * @internal\n */\nexport function getBridgeContext(name: string | undefined, hash: string): BridgeContext {\n if (name) return JSON.parse(name);\n const json = hash?.slice(1); // Strip the leading '#' from the hash\n if (!json) throw Error('no bridge context');\n return JSON.parse(decodeURIComponent(json));\n}\n", "/** Injects an auth token into /api/ requests. */\nexport async function fetch(\n authToken: string,\n globalFetch: typeof globalThis.fetch,\n location: Readonly<Location>,\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n const req = new Request(input, init);\n if (isSameSite(location, new URL(req.url)))\n req.headers.set('Authorization', `Bearer ${authToken}`);\n // to-do: pass devvit-debug from BridgeContext.\n return await globalFetch(req);\n}\n\n/** @internal */\nexport function isSameSite(location: Readonly<Location>, url: URL): boolean {\n return url.origin === location.origin;\n}\n", "import { initAnalytics } from './analytics.js';\nimport { initDevvitGlobal } from './devvit-global.js';\nimport { fetch } from './fetch.js';\n\ninitDevvitGlobal(document, location, window);\ninitAnalytics();\n\nglobalThis.fetch = fetch.bind(undefined, devvit.token, globalThis.fetch, location);\n"],
4
+ "sourcesContent": ["{\"hash\":\"63705be\",\"version\":\"0.12.2-dev\"}", "/**\n * #post_message.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var WebViewInternalMessageScope;\n(function (WebViewInternalMessageScope) {\n /** CLIENT - Message is intended for the client only */\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"CLIENT\"] = 0] = \"CLIENT\";\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(WebViewInternalMessageScope || (WebViewInternalMessageScope = {}));\n", "import {\n type WebViewInternalMessage,\n WebViewInternalMessageScope,\n} from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js';\n\n/**\n * initAnalytics is added to all Devvit apps which use web views.\n *\n * This sends interaction events to the parent window via postMessage.\n * These metrics are used to inform app performance and feed ranking.\n */\nexport function initAnalytics(): void {\n addEventListener('load', () => {\n const timeStart = performance.timeOrigin;\n const duration = performance.now();\n const timeEnd = performance.timeOrigin + duration;\n\n // to-do: support devvit.debug.\n // if (devvit.debug.analytics) console.debug(`[analytics] loaded in ${duration} ms`);\n postWebViewInternalMessage({\n scope: WebViewInternalMessageScope.CLIENT,\n type: 'devvit-internal',\n analytics: { event: 'web-view-loaded', timeStart, timeEnd, duration },\n });\n });\n\n document.addEventListener(\n 'pointerdown',\n () => {\n postWebViewInternalMessage({\n scope: WebViewInternalMessageScope.CLIENT,\n type: 'devvit-internal',\n analytics: { event: 'click' },\n });\n },\n { passive: true }\n );\n}\n\nfunction postWebViewInternalMessage(internalMessage: WebViewInternalMessage): void {\n parent.postMessage(internalMessage, '*');\n}\n", "export function assert(condition, msg) {\n if (!condition)\n throw Error(msg);\n}\n", "import { assert } from './assert.js';\n// CALMS!\nexport var T_PREFIX;\n(function (T_PREFIX) {\n T_PREFIX[\"COMMENT\"] = \"t1_\";\n T_PREFIX[\"ACCOUNT\"] = \"t2_\";\n T_PREFIX[\"LINK\"] = \"t3_\";\n T_PREFIX[\"MESSAGE\"] = \"t4_\";\n T_PREFIX[\"SUBREDDIT\"] = \"t5_\";\n T_PREFIX[\"AWARD\"] = \"t6_\";\n})(T_PREFIX || (T_PREFIX = {}));\n// type guards\nexport function isT1(id) {\n return id.startsWith(T_PREFIX.COMMENT);\n}\nexport function isT2(id) {\n return id.startsWith(T_PREFIX.ACCOUNT);\n}\nexport function isT3(id) {\n return id.startsWith(T_PREFIX.LINK);\n}\nexport function isT4(id) {\n return id.startsWith(T_PREFIX.MESSAGE);\n}\nexport function isT5(id) {\n return id.startsWith(T_PREFIX.SUBREDDIT);\n}\nexport function isT6(id) {\n return id.startsWith(T_PREFIX.AWARD);\n}\n// assertion functions\nexport function assertT1(id) {\n assert(isT1(id), `Expected comment id to start with ${T_PREFIX.COMMENT}, got ${id}}`);\n}\nexport function assertT2(id) {\n assert(isT2(id), `Expected account id to start with ${T_PREFIX.ACCOUNT}, got ${id}}`);\n}\nexport function assertT3(id) {\n assert(isT3(id), `Expected link id to start with ${T_PREFIX.LINK}, got ${id}}`);\n}\nexport function assertT4(id) {\n assert(isT4(id), `Expected message id to start with ${T_PREFIX.MESSAGE}, got ${id}}`);\n}\nexport function assertT5(id) {\n assert(isT5(id), `Expected subreddit id to start with ${T_PREFIX.SUBREDDIT}, got ${id}}`);\n}\nexport function assertT6(id) {\n assert(isT6(id), `Expected award id to start with ${T_PREFIX.AWARD}, got ${id}}`);\n}\n// factory functions\nexport function T1(id) {\n assertT1(id);\n return id;\n}\nexport function T2(id) {\n assertT2(id);\n return id;\n}\nexport function T3(id) {\n assertT3(id);\n return id;\n}\nexport function T4(id) {\n assertT4(id);\n return id;\n}\nexport function T5(id) {\n assertT5(id);\n return id;\n}\nexport function T6(id) {\n assertT6(id);\n return id;\n}\nexport function asTid(id) {\n if (isT1(id)) {\n return T1(id);\n }\n if (isT2(id)) {\n return T2(id);\n }\n if (isT3(id)) {\n return T3(id);\n }\n if (isT4(id)) {\n return T4(id);\n }\n if (isT5(id)) {\n return T5(id);\n }\n if (isT6(id)) {\n return T6(id);\n }\n throw new Error(`Expected thing id to start with ${Object.values(T_PREFIX).join(', ')} got ${id}}`);\n}\n", "/**\n * The `@devvit/client` version query parameter name the web view's document\n * script tag:\n *\n * <script src=\"https://webview.devvit.net/scripts/devvit.v1.min.js?clientVersion=1.2.3\"></script>\n *\n * The value is the version of `@devvit/client` bundled with the app.\n * `@devvit/client` may have runtime dependencies on\n * `@devvit/web-view-scripts` (`devvit.v1.min.js`) which is not bundled. The\n * client version can be used to specialize behavior to match the static\n * expectations of the `@devvit/client` version.\n */\nexport const clientVersionQueryParam = 'clientVersion';\n", "import { clientVersionQueryParam } from '@devvit/shared-types/web-view-scripts-constants.js';\n\n/**\n * Queries the client version (eg, `'1.2.3'`) from the iframe document's script\n * tag:\n *\n * <script src=\"https://webview.devvit.net/scripts/devvit.v1.min.js?clientVersion=1.2.3\"></script>\n *\n * See `clientVersionQueryParam`.\n */\nexport function queryClientVersion(document: {\n readonly currentScript: { readonly src: string } | SVGScriptElement | null;\n}): string | undefined {\n if (document.currentScript && 'src' in document.currentScript)\n return (\n new URL(document.currentScript.src).searchParams.get(clientVersionQueryParam) ?? undefined\n );\n}\n", "export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n", "import type { RequestContext } from '@devvit/protos/json/devvit/platform/request_context.js';\nimport { jwtDecode } from 'jwt-decode';\n\n// to-do: make a Protobuf for ContextClaims.\nexport type ContextClaims = { devvit: RequestContext };\n\nexport function decodeToken(token: string | undefined): RequestContext | undefined {\n if (!token) return;\n\n try {\n return jwtDecode<ContextClaims>(token)?.devvit;\n } catch (err) {\n throw Error('token decode failure', { cause: err });\n }\n}\n", "import type { DevvitPostData } from '@devvit/protos';\nimport type { RequestContext } from '@devvit/protos/json/devvit/platform/request_context.js';\nimport type {\n BridgeContext,\n WebViewClientData,\n WebViewContext,\n} from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';\nimport type { Context } from '@devvit/shared-types/client/client-context.js';\nimport type {\n DevvitGlobal,\n WebViewScriptsVersion,\n} from '@devvit/shared-types/client/devvit-global.js';\nimport { T2, T3, T5 } from '@devvit/shared-types/tid.js';\nimport { type WebbitToken } from '@devvit/shared-types/webbit.js';\n\nimport { queryClientVersion } from './client.js';\nimport { decodeToken } from './token.js';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var devvit: DevvitGlobal;\n /** Defined by build.js. */\n // eslint-disable-next-line no-var\n var webViewScriptsVersion: Readonly<WebViewScriptsVersion>;\n}\n\n/** @internal */\nexport const initDevvitGlobal = (\n document: { readonly currentScript: { readonly src: string } | SVGScriptElement | null },\n location: { readonly hash: string },\n window: { readonly name: string }\n): void => {\n const bridge = getBridgeContext(window.name, location.hash);\n\n const reqCtx = decodeToken(bridge.signedRequestContext);\n\n let context;\n if (reqCtx) context = contextFromRequestContext(reqCtx, bridge.postData);\n else if (bridge.webViewContext)\n context = contextFromWebViewContext(bridge.webViewContext, bridge.postData);\n if (!context) throw Error('no context');\n\n // to-do: expose `BridgeContext.client`, `devvitDebug`,\n // `nativeVersion` / `shredditVersion`.\n\n const clientData: WebViewClientData | undefined = bridge.webViewClientData;\n globalThis.devvit = {\n context,\n dependencies: {\n client: queryClientVersion(document),\n webViewScripts: globalThis.webViewScriptsVersion,\n },\n entrypoints: clientData?.appConfig?.entrypoints ?? {},\n share: bridge?.shareParam ? { userData: bridge?.shareParam.userData } : undefined,\n appPermissionState: bridge?.appPermissionState,\n // to-do: prefer signed request context once understood by backend.\n token: (bridge.webbitToken || bridge.signedRequestContext) as WebbitToken,\n webViewMode: bridge?.viewMode,\n };\n};\n\n/** @internal */\nexport function contextFromRequestContext(\n reqCtx: Readonly<RequestContext>,\n postData: Readonly<DevvitPostData> | undefined\n): Context {\n if (!reqCtx.app) throw Error('no RequestContext.app');\n if (!reqCtx.post) throw Error('no RequestContext.post');\n if (!reqCtx.subreddit) throw Error('no RequestContext.subreddit');\n return {\n appName: reqCtx.app.name,\n appVersion: reqCtx.app.version,\n postAuthorId: T2(reqCtx.post.author),\n postData: postData?.developerData,\n postId: T3(reqCtx.post.id),\n snoovatar: reqCtx.user?.snoovatar,\n subredditId: T5(reqCtx.subreddit.id),\n subredditName: reqCtx.subreddit.name,\n userId: reqCtx.user?.id ? T2(reqCtx.user.id) : undefined,\n username: reqCtx.user?.name,\n };\n}\n\n/** @internal */\nexport function contextFromWebViewContext(\n webViewCtx: Readonly<WebViewContext>,\n postData: Readonly<DevvitPostData> | undefined\n): Context {\n return {\n appName: webViewCtx.appName,\n appVersion: webViewCtx.appVersion,\n postData: postData?.developerData,\n postAuthorId: undefined,\n postId: T3(webViewCtx.postId),\n snoovatar: undefined,\n subredditId: T5(webViewCtx.subredditId),\n subredditName: webViewCtx.subredditName,\n userId: webViewCtx.userId ? T2(webViewCtx.userId) : undefined,\n username: undefined,\n };\n}\n\n/**\n * Extracts the BridgeContext from the hash.\n * @internal\n */\nexport function getBridgeContext(name: string | undefined, hash: string): BridgeContext {\n if (name) return JSON.parse(name);\n const json = hash?.slice(1); // Strip the leading '#' from the hash\n if (!json) throw Error('no bridge context');\n return JSON.parse(decodeURIComponent(json));\n}\n", "/** Injects an auth token into /api/ requests. */\nexport async function fetch(\n authToken: string,\n globalFetch: typeof globalThis.fetch,\n location: Readonly<Location>,\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n const req = new Request(input, init);\n if (isSameSite(location, new URL(req.url)))\n req.headers.set('Authorization', `Bearer ${authToken}`);\n // to-do: pass devvit-debug from BridgeContext.\n return await globalFetch(req);\n}\n\n/** @internal */\nexport function isSameSite(location: Readonly<Location>, url: URL): boolean {\n return url.origin === location.origin;\n}\n", "import { initAnalytics } from './analytics.js';\nimport { initDevvitGlobal } from './devvit-global.js';\nimport { fetch } from './fetch.js';\n\ninitDevvitGlobal(document, location, window);\ninitAnalytics();\n\nglobalThis.fetch = fetch.bind(undefined, devvit.token, globalThis.fetch, location);\n"],
5
5
  "mappings": "mBAAA,IAAAA,EAAA,CAAC,KAAO,UAAU,QAAU,YAAY,ECOjC,IAAIC,GACV,SAAUA,EAA6B,CAEpCA,EAA4BA,EAA4B,OAAY,CAAC,EAAI,SACzEA,EAA4BA,EAA4B,aAAkB,EAAE,EAAI,cACpF,GAAGA,IAAgCA,EAA8B,CAAC,EAAE,ECD7D,SAASC,GAAsB,CACpC,iBAAiB,OAAQ,IAAM,CAC7B,IAAMC,EAAY,YAAY,WACxBC,EAAW,YAAY,IAAI,EAC3BC,EAAU,YAAY,WAAaD,EAIzCE,EAA2B,CACzB,MAAOC,EAA4B,OACnC,KAAM,kBACN,UAAW,CAAE,MAAO,kBAAmB,UAAAJ,EAAW,QAAAE,EAAS,SAAAD,CAAS,CACtE,CAAC,CACH,CAAC,EAED,SAAS,iBACP,cACA,IAAM,CACJE,EAA2B,CACzB,MAAOC,EAA4B,OACnC,KAAM,kBACN,UAAW,CAAE,MAAO,OAAQ,CAC9B,CAAC,CACH,EACA,CAAE,QAAS,EAAK,CAClB,CACF,CAEA,SAASD,EAA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,OAC/C,SAAUA,EAAO,MAAM,IACzB,CACF,CAGO,SAASI,EACdQ,EACAJ,EACS,CACT,MAAO,CACL,QAASI,EAAW,QACpB,WAAYA,EAAW,WACvB,SAAUJ,GAAU,cACpB,aAAc,OACd,OAAQE,EAAGE,EAAW,MAAM,EAC5B,UAAW,OACX,YAAaD,EAAGC,EAAW,WAAW,EACtC,cAAeA,EAAW,cAC1B,OAAQA,EAAW,OAASH,EAAGG,EAAW,MAAM,EAAI,OACpD,SAAU,MACZ,CACF,CAMO,SAASb,EAAiBc,EAA0BC,EAA6B,CACtF,GAAID,EAAM,OAAO,KAAK,MAAMA,CAAI,EAChC,IAAME,EAAOD,GAAM,MAAM,CAAC,EAC1B,GAAI,CAACC,EAAM,MAAM,MAAM,mBAAmB,EAC1C,OAAO,KAAK,MAAM,mBAAmBA,CAAI,CAAC,CAC5C,CC9GA,eAAsBC,EACpBC,EACAC,EACAC,EACAC,EACAC,EACmB,CACnB,IAAMC,EAAM,IAAI,QAAQF,EAAOC,CAAI,EACnC,OAAIE,EAAWJ,EAAU,IAAI,IAAIG,EAAI,GAAG,CAAC,GACvCA,EAAI,QAAQ,IAAI,gBAAiB,UAAUL,CAAS,EAAE,EAEjD,MAAMC,EAAYI,CAAG,CAC9B,CAGO,SAASC,EAAWJ,EAA8BK,EAAmB,CAC1E,OAAOA,EAAI,SAAWL,EAAS,MACjC,CCdAM,EAAiB,SAAU,SAAU,MAAM,EAC3CC,EAAc,EAEd,WAAW,MAAQC,EAAM,KAAK,OAAW,OAAO,MAAO,WAAW,MAAO,QAAQ",
6
6
  "names": ["define_globalThis_webViewScriptsVersion_default", "WebViewInternalMessageScope", "initAnalytics", "timeStart", "duration", "timeEnd", "postWebViewInternalMessage", "WebViewInternalMessageScope", "internalMessage", "assert", "condition", "msg", "T_PREFIX", "isT2", "id", "T_PREFIX", "isT3", "isT5", "id", "T_PREFIX", "assertT2", "id", "assert", "isT2", "T_PREFIX", "assertT3", "isT3", "assertT5", "id", "assert", "isT5", "T_PREFIX", "T2", "id", "assertT2", "T3", "assertT3", "T5", "id", "assertT5", "clientVersionQueryParam", "queryClientVersion", "document", "clientVersionQueryParam", "InvalidTokenError", "b64DecodeUnicode", "str", "m", "p", "code", "base64UrlDecode", "output", "jwtDecode", "token", "options", "pos", "part", "decoded", "e", "decodeToken", "token", "jwtDecode", "err", "initDevvitGlobal", "document", "location", "window", "bridge", "getBridgeContext", "reqCtx", "decodeToken", "context", "contextFromRequestContext", "contextFromWebViewContext", "clientData", "queryClientVersion", "define_globalThis_webViewScriptsVersion_default", "postData", "T2", "T3", "T5", "webViewCtx", "name", "hash", "json", "fetch", "authToken", "globalFetch", "location", "input", "init", "req", "isSameSite", "url", "initDevvitGlobal", "initAnalytics", "fetch"]
7
7
  }