@adlad/plugin-viverse 0.1.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/.dvmrc ADDED
@@ -0,0 +1 @@
1
+ 2.6.4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pelican Party
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/deno.jsonc ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "compilerOptions": {
3
+ "checkJs": true
4
+ },
5
+ "tasks": {
6
+ // Updates third party types. Useful if you want type checking in your IDE.
7
+ "dev": "deno run --unstable -A scripts/dev.js",
8
+ // performs all tasks that are generally required for ci to pass
9
+ "check": "deno fmt --check && deno lint",
10
+ // Bundles AdLad into a single file so that it can be published to package managers.
11
+ "bundle": "deno run --allow-read --allow-write --allow-env --allow-run scripts/bundle.js"
12
+ },
13
+ "nodeModulesDir": "auto",
14
+ "fmt": {
15
+ "exclude": [
16
+ ".denoTypes",
17
+ "dist",
18
+ ".github/workflows"
19
+ ],
20
+ "indentWidth": 4,
21
+ "useTabs": true,
22
+ "lineWidth": 120,
23
+ "proseWrap": "preserve"
24
+ },
25
+ "lint": {
26
+ "exclude": [
27
+ ".denoTypes",
28
+ "dist"
29
+ ],
30
+ "rules": {
31
+ "exclude": ["require-await", "no-window", "no-import-prefix"]
32
+ }
33
+ },
34
+ "importMap": "importmap.json"
35
+ }
package/deno.lock ADDED
@@ -0,0 +1,296 @@
1
+ {
2
+ "version": "5",
3
+ "specifiers": {
4
+ "npm:@adlad/adlad@1.0.0": "1.0.0",
5
+ "npm:rollup@3.17.3": "3.17.3",
6
+ "npm:terser@5.15.0": "5.15.0",
7
+ "npm:typescript@4.7.4": "4.7.4",
8
+ "npm:typescript@4.9.5": "4.9.5",
9
+ "npm:typescript@5.2.2": "5.2.2"
10
+ },
11
+ "npm": {
12
+ "@adlad/adlad@1.0.0": {
13
+ "integrity": "sha512-XcFoPBQmqTSNkpy4RSgbChyMT3BL9X72rpGCLIG4vcMhjxg6pveZZ19zo7c+utOYx/8NVP5dJvnGI9qFHBIKhg=="
14
+ },
15
+ "@jridgewell/gen-mapping@0.3.13": {
16
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
17
+ "dependencies": [
18
+ "@jridgewell/sourcemap-codec",
19
+ "@jridgewell/trace-mapping"
20
+ ]
21
+ },
22
+ "@jridgewell/resolve-uri@3.1.2": {
23
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="
24
+ },
25
+ "@jridgewell/source-map@0.3.11": {
26
+ "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",
27
+ "dependencies": [
28
+ "@jridgewell/gen-mapping",
29
+ "@jridgewell/trace-mapping"
30
+ ]
31
+ },
32
+ "@jridgewell/sourcemap-codec@1.5.5": {
33
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="
34
+ },
35
+ "@jridgewell/trace-mapping@0.3.30": {
36
+ "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==",
37
+ "dependencies": [
38
+ "@jridgewell/resolve-uri",
39
+ "@jridgewell/sourcemap-codec"
40
+ ]
41
+ },
42
+ "acorn@8.15.0": {
43
+ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
44
+ "bin": true
45
+ },
46
+ "buffer-from@1.1.2": {
47
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
48
+ },
49
+ "commander@2.20.3": {
50
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
51
+ },
52
+ "fsevents@2.3.3": {
53
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
54
+ "os": ["darwin"],
55
+ "scripts": true
56
+ },
57
+ "rollup@3.17.3": {
58
+ "integrity": "sha512-p5LaCXiiOL/wrOkj8djsIDFmyU9ysUxcyW+EKRLHb6TKldJzXpImjcRSR+vgo09DBdofGcOoLOsRyxxG2n5/qQ==",
59
+ "optionalDependencies": [
60
+ "fsevents"
61
+ ],
62
+ "bin": true
63
+ },
64
+ "source-map-support@0.5.21": {
65
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
66
+ "dependencies": [
67
+ "buffer-from",
68
+ "source-map"
69
+ ]
70
+ },
71
+ "source-map@0.6.1": {
72
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
73
+ },
74
+ "terser@5.15.0": {
75
+ "integrity": "sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==",
76
+ "dependencies": [
77
+ "@jridgewell/source-map",
78
+ "acorn",
79
+ "commander",
80
+ "source-map-support"
81
+ ],
82
+ "bin": true
83
+ },
84
+ "typescript@4.7.4": {
85
+ "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
86
+ "bin": true
87
+ },
88
+ "typescript@4.9.5": {
89
+ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
90
+ "bin": true
91
+ },
92
+ "typescript@5.2.2": {
93
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
94
+ "bin": true
95
+ }
96
+ },
97
+ "remote": {
98
+ "https://deno.land/std@0.119.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58",
99
+ "https://deno.land/std@0.119.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac",
100
+ "https://deno.land/std@0.119.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853",
101
+ "https://deno.land/std@0.119.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4",
102
+ "https://deno.land/std@0.119.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b",
103
+ "https://deno.land/std@0.119.0/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4",
104
+ "https://deno.land/std@0.119.0/path/glob.ts": "ea87985765b977cc284b92771003b2070c440e0807c90e1eb0ff3e095911a820",
105
+ "https://deno.land/std@0.119.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12",
106
+ "https://deno.land/std@0.119.0/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2",
107
+ "https://deno.land/std@0.119.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c",
108
+ "https://deno.land/std@0.119.0/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e",
109
+ "https://deno.land/std@0.145.0/_deno_unstable.ts": "be3276fd42cffb49f51b705c4b0aa8656aaf2a34be22d769455c8e50ea38e51a",
110
+ "https://deno.land/std@0.145.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
111
+ "https://deno.land/std@0.145.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49",
112
+ "https://deno.land/std@0.145.0/fs/_util.ts": "2cf50bfb1081c2d5f2efec10ac19abbc2baf478e51cd1b057d0da2f30585b6ba",
113
+ "https://deno.land/std@0.145.0/fs/copy.ts": "9248d1492599957af8c693ceb10a432b09f0b0b61c60a4d6aff29b0c7d3a17b3",
114
+ "https://deno.land/std@0.145.0/fs/empty_dir.ts": "7274d87160de34cbed0531e284df383045cf43543bbeadeb97feac598bd8f3c5",
115
+ "https://deno.land/std@0.145.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d",
116
+ "https://deno.land/std@0.145.0/fs/ensure_file.ts": "7d353e64fee3d4d1e7c6b6726a2a5e987ba402c15fb49566309042887349c545",
117
+ "https://deno.land/std@0.145.0/fs/ensure_link.ts": "489e23df9fe3e6636048b5830ddf0f111eb29621eb85719255ad9bd645f3471b",
118
+ "https://deno.land/std@0.145.0/fs/ensure_symlink.ts": "88dc83de1bc90ed883dd458c2d2eae3d5834a4617d12925734836e1f0803b274",
119
+ "https://deno.land/std@0.145.0/fs/eol.ts": "b92f0b88036de507e7e6fbedbe8f666835ea9dcbf5ac85917fa1fadc919f83a5",
120
+ "https://deno.land/std@0.145.0/fs/exists.ts": "cb734d872f8554ea40b8bff77ad33d4143c1187eac621a55bf37781a43c56f6d",
121
+ "https://deno.land/std@0.145.0/fs/expand_glob.ts": "143400698822117018c3646f4b7d2d418bc5cdede1ec837a8c70013b7711c761",
122
+ "https://deno.land/std@0.145.0/fs/mod.ts": "4dc052c461c171abb5c25f6e0f218ab838a716230930b534ba351745864b7d6d",
123
+ "https://deno.land/std@0.145.0/fs/move.ts": "0573cedcf583f09a9494f2dfccbf67de68a93629942d6b5e6e74a9e45d4e8a2e",
124
+ "https://deno.land/std@0.145.0/fs/walk.ts": "6ce8d87fbaeda23383e979599ad27f3f94b3e5ff0c0cd976b5fc5c2aa0df7d92",
125
+ "https://deno.land/std@0.145.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3",
126
+ "https://deno.land/std@0.145.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09",
127
+ "https://deno.land/std@0.145.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b",
128
+ "https://deno.land/std@0.145.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633",
129
+ "https://deno.land/std@0.145.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee",
130
+ "https://deno.land/std@0.145.0/path/mod.ts": "4945b430b759b0b3d98f2a278542cbcf95e0ad2bd8eaaed3c67322b306b2b346",
131
+ "https://deno.land/std@0.145.0/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa",
132
+ "https://deno.land/std@0.145.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9",
133
+ "https://deno.land/std@0.145.0/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c",
134
+ "https://deno.land/std@0.150.0/_deno_unstable.ts": "be3276fd42cffb49f51b705c4b0aa8656aaf2a34be22d769455c8e50ea38e51a",
135
+ "https://deno.land/std@0.150.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
136
+ "https://deno.land/std@0.150.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49",
137
+ "https://deno.land/std@0.150.0/archive/tar.ts": "b42e974bdbc97526e8591ecaed59e3469955e742183fa609603b3f0b4862fa52",
138
+ "https://deno.land/std@0.150.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a",
139
+ "https://deno.land/std@0.150.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4",
140
+ "https://deno.land/std@0.150.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a",
141
+ "https://deno.land/std@0.150.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf",
142
+ "https://deno.land/std@0.150.0/fs/_util.ts": "2cf50bfb1081c2d5f2efec10ac19abbc2baf478e51cd1b057d0da2f30585b6ba",
143
+ "https://deno.land/std@0.150.0/fs/copy.ts": "9248d1492599957af8c693ceb10a432b09f0b0b61c60a4d6aff29b0c7d3a17b3",
144
+ "https://deno.land/std@0.150.0/fs/empty_dir.ts": "7274d87160de34cbed0531e284df383045cf43543bbeadeb97feac598bd8f3c5",
145
+ "https://deno.land/std@0.150.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d",
146
+ "https://deno.land/std@0.150.0/fs/ensure_file.ts": "7d353e64fee3d4d1e7c6b6726a2a5e987ba402c15fb49566309042887349c545",
147
+ "https://deno.land/std@0.150.0/fs/ensure_link.ts": "489e23df9fe3e6636048b5830ddf0f111eb29621eb85719255ad9bd645f3471b",
148
+ "https://deno.land/std@0.150.0/fs/ensure_symlink.ts": "88dc83de1bc90ed883dd458c2d2eae3d5834a4617d12925734836e1f0803b274",
149
+ "https://deno.land/std@0.150.0/fs/eol.ts": "b92f0b88036de507e7e6fbedbe8f666835ea9dcbf5ac85917fa1fadc919f83a5",
150
+ "https://deno.land/std@0.150.0/fs/exists.ts": "cb734d872f8554ea40b8bff77ad33d4143c1187eac621a55bf37781a43c56f6d",
151
+ "https://deno.land/std@0.150.0/fs/expand_glob.ts": "143400698822117018c3646f4b7d2d418bc5cdede1ec837a8c70013b7711c761",
152
+ "https://deno.land/std@0.150.0/fs/mod.ts": "7111008fcdf935f1bfdf07f881f4d1e152063d146025e9622ae12d1fd5f4d7b8",
153
+ "https://deno.land/std@0.150.0/fs/move.ts": "0573cedcf583f09a9494f2dfccbf67de68a93629942d6b5e6e74a9e45d4e8a2e",
154
+ "https://deno.land/std@0.150.0/fs/walk.ts": "6ce8d87fbaeda23383e979599ad27f3f94b3e5ff0c0cd976b5fc5c2aa0df7d92",
155
+ "https://deno.land/std@0.150.0/io/buffer.ts": "bd0c4bf53db4b4be916ca5963e454bddfd3fcd45039041ea161dbf826817822b",
156
+ "https://deno.land/std@0.150.0/io/readers.ts": "45847ad404afd2f605eae1cff193f223462bc55eeb9ae313c2f3db28aada0fd6",
157
+ "https://deno.land/std@0.150.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3",
158
+ "https://deno.land/std@0.150.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09",
159
+ "https://deno.land/std@0.150.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b",
160
+ "https://deno.land/std@0.150.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633",
161
+ "https://deno.land/std@0.150.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee",
162
+ "https://deno.land/std@0.150.0/path/mod.ts": "4945b430b759b0b3d98f2a278542cbcf95e0ad2bd8eaaed3c67322b306b2b346",
163
+ "https://deno.land/std@0.150.0/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa",
164
+ "https://deno.land/std@0.150.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9",
165
+ "https://deno.land/std@0.150.0/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c",
166
+ "https://deno.land/std@0.150.0/streams/buffer.ts": "ee47194022d47fa23d4749b8afbadc83c237c4595467a9bddb322af0dd205815",
167
+ "https://deno.land/std@0.150.0/streams/conversion.ts": "fc3db02026183da795fa32ac7549868e9f19c75ba029d4b4c3739af62b48517a",
168
+ "https://deno.land/std@0.150.0/streams/delimiter.ts": "4c568cdbdc71a8563f8e3b032ec0bbd52992fc4a1cf257baa00cf6b4f7034bd4",
169
+ "https://deno.land/std@0.150.0/streams/merge.ts": "88ed3dfa030ae076802688e4cadd762a251a41d81ed1776dfd9a2a9a0e970195",
170
+ "https://deno.land/std@0.150.0/streams/mod.ts": "d7d8fa97f79bca052eba8b6df9c4602403d144cf97ec9f6d0896c787dae0a9de",
171
+ "https://deno.land/std@0.157.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4",
172
+ "https://deno.land/std@0.159.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
173
+ "https://deno.land/std@0.159.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4",
174
+ "https://deno.land/std@0.159.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a",
175
+ "https://deno.land/std@0.159.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf",
176
+ "https://deno.land/std@0.159.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4",
177
+ "https://deno.land/std@0.159.0/fs/exists.ts": "6a447912e49eb79cc640adacfbf4b0baf8e17ede6d5bed057062ce33c4fa0d68",
178
+ "https://deno.land/std@0.159.0/io/buffer.ts": "fae02290f52301c4e0188670e730cd902f9307fb732d79c4aa14ebdc82497289",
179
+ "https://deno.land/std@0.159.0/log/handlers.ts": "62e9ec601c2058277b484c445621c13e070cfbd24eed8e161b9732d94edc7dca",
180
+ "https://deno.land/std@0.159.0/log/levels.ts": "82c965b90f763b5313e7595d4ba78d5095a13646d18430ebaf547526131604d1",
181
+ "https://deno.land/std@0.159.0/log/logger.ts": "b545159727b023825ee6814d9178fb2a7472f8d95d704c253b771b95c658cf8c",
182
+ "https://deno.land/std@0.159.0/log/mod.ts": "62d56c28e8fbaa0f6c8b6df41cb31e47c51ae8a93e78559612ecb5a4f76d7424",
183
+ "https://deno.land/std@0.167.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272",
184
+ "https://deno.land/std@0.167.0/async/deferred.ts": "77d3f84255c3627f1cc88699d8472b664d7635990d5358c4351623e098e917d6",
185
+ "https://deno.land/std@0.167.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4",
186
+ "https://deno.land/std@0.167.0/bytes/concat.ts": "97a1274e117510ffffc9499c4debb9541e408732bab2e0ca624869ae13103c10",
187
+ "https://deno.land/std@0.167.0/bytes/copy.ts": "d14a58f188a997ee0d2ba696d0c82a42f4fb4b6705e90a4238b77d7644dae24c",
188
+ "https://deno.land/std@0.167.0/io/buffer.ts": "9d6f555ded12960bd5a44f57291a82270cca0a77bde6cadd1384a03a86bf876a",
189
+ "https://deno.land/std@0.167.0/streams/_common.ts": "a931bdab61de705bbfeda25d7bcf8e6edbba37492f90737b3c2889604313df46",
190
+ "https://deno.land/std@0.167.0/streams/buffer.ts": "53823f5a5b417998c568ea2f4060c5eb5c368e7c0147c79b343f5e18840d465a",
191
+ "https://deno.land/std@0.167.0/streams/byte_slice_stream.ts": "65141918827f4063e052d9937fd472fedfa1a381cdccd674065839506016b2e3",
192
+ "https://deno.land/std@0.167.0/streams/conversion.ts": "2d2127a08be7ba28ef26c6ff1b2fec442109e5aac09c79cbe36fb0883d51645f",
193
+ "https://deno.land/std@0.167.0/streams/copy.ts": "9a972a4befee3306095e9bb058a5a4d73b681df6ca088d7209f9a0736271aadc",
194
+ "https://deno.land/std@0.167.0/streams/delimiter.ts": "f40b10fce22253ac4cbdc31c7263a583aeb2a96336e2f5a2d3a20102e996f831",
195
+ "https://deno.land/std@0.167.0/streams/delimiter_stream.ts": "dfc73a5324f15a53ea654fcc8b47c321f3bef6ec4499be44902f0aed5b1eed1e",
196
+ "https://deno.land/std@0.167.0/streams/early_zip_readable_streams.ts": "1a4e1b8b9018638e2c0fefd4d0bce3bcffa7d1673630c9c817eba0cdde794a50",
197
+ "https://deno.land/std@0.167.0/streams/iterate_reader.ts": "26adde791b4206a8abbbd6365a8845b88aef396c1fd642066ec8e8480675e6a1",
198
+ "https://deno.land/std@0.167.0/streams/limited_bytes_transform_stream.ts": "3b7327a39d7f2c4799c94e853f3bfe43d9434edc2074a33fec8800252052576f",
199
+ "https://deno.land/std@0.167.0/streams/limited_transform_stream.ts": "abb275b2d52d8817edacc63e966ca9dd14eaa956b231d217c28ffd327e097c7e",
200
+ "https://deno.land/std@0.167.0/streams/merge.ts": "52ba365c4e2d5c9c7eaf0bb2afb14c8f9fc63b106eba94306154fb89dceb1aa6",
201
+ "https://deno.land/std@0.167.0/streams/merge_readable_streams.ts": "afa207eaa42a4b7299405b0e40b4dd023bc557be07219ba5e91b9492aa54096d",
202
+ "https://deno.land/std@0.167.0/streams/mod.ts": "8c435c78bef0bf890ab01d66a02e378ef34835dc2526dde56bd34d2f5625750d",
203
+ "https://deno.land/std@0.167.0/streams/read_all.ts": "52c733b63ca52af7d78326228529d7d629d5b3bb7c34c0a0261b5a6ecc209e73",
204
+ "https://deno.land/std@0.167.0/streams/readable_stream_from_iterable.ts": "eaa03bf3b7fbffa665d3d9c30435dcce3437c67559f97eaccc58995d3efcf8cd",
205
+ "https://deno.land/std@0.167.0/streams/readable_stream_from_reader.ts": "fa1e01839d214826a1547f108f2858d9f97b267ccf2523bf08c6db3e07ae3124",
206
+ "https://deno.land/std@0.167.0/streams/reader_from_iterable.ts": "91ebe9cfed2422b7193e222e3479d31f7906171df4f94e0d8df35877b9d15e69",
207
+ "https://deno.land/std@0.167.0/streams/reader_from_stream_reader.ts": "88043a2b2932443e1b5133264283ded6872bec0604d4e69235ebf73e5e9ddde3",
208
+ "https://deno.land/std@0.167.0/streams/text_delimiter_stream.ts": "03150e093373222c51cb94b8518fb4f789990a5ffdee767a3952a599fe56226f",
209
+ "https://deno.land/std@0.167.0/streams/text_line_stream.ts": "9c402985714fe454dad6b59df8a6de7bf13fcb7ae027f35226b0b76d90a1dc60",
210
+ "https://deno.land/std@0.167.0/streams/to_transform_stream.ts": "f3fea34e2d338d9022079d2e756a834b4c233758ad2bcdb43ace326b06c8d36c",
211
+ "https://deno.land/std@0.167.0/streams/writable_stream_from_writer.ts": "ae8daf9f524c449485235900746d195c4d845bb452aed679e67288a9b6848f3b",
212
+ "https://deno.land/std@0.167.0/streams/write_all.ts": "7525aa90e34a2bb56d094403ad9c0e31e7db87a47cb556e6dc0404e6deca084c",
213
+ "https://deno.land/std@0.167.0/streams/writer_from_stream_writer.ts": "eee7964dc30acc74a02fc52f98f3a4fd46d1382d7897859b21eeebbd0a754ec6",
214
+ "https://deno.land/std@0.167.0/streams/zip_readable_streams.ts": "17d5e6625a60ae4268dfd1ddb9aefa3c7f048ed854d4c20d4c05b646dc0e006b",
215
+ "https://deno.land/std@0.178.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462",
216
+ "https://deno.land/std@0.178.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3",
217
+ "https://deno.land/std@0.178.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0",
218
+ "https://deno.land/std@0.178.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b",
219
+ "https://deno.land/std@0.178.0/path/_util.ts": "d7abb1e0dea065f427b89156e28cdeb32b045870acdf865833ba808a73b576d0",
220
+ "https://deno.land/std@0.178.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000",
221
+ "https://deno.land/std@0.178.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1",
222
+ "https://deno.land/std@0.178.0/path/mod.ts": "4b83694ac500d7d31b0cdafc927080a53dc0c3027eb2895790fb155082b0d232",
223
+ "https://deno.land/std@0.178.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d",
224
+ "https://deno.land/std@0.178.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1",
225
+ "https://deno.land/std@0.178.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba",
226
+ "https://deno.land/std@0.202.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee",
227
+ "https://deno.land/std@0.202.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56",
228
+ "https://deno.land/std@0.202.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978",
229
+ "https://deno.land/std@0.202.0/fs/copy.ts": "23cc1c465babe5ca4d69778821e2f8addc44593e30a5ca0b902b3784eed75bb6",
230
+ "https://deno.land/std@0.202.0/fs/empty_dir.ts": "2e52cd4674d18e2e007175c80449fc3d263786a1361e858d9dfa9360a6581b47",
231
+ "https://deno.land/std@0.202.0/fs/ensure_dir.ts": "dc64c4c75c64721d4e3fb681f1382f803ff3d2868f08563ff923fdd20d071c40",
232
+ "https://deno.land/std@0.202.0/fs/ensure_file.ts": "39ac83cc283a20ec2735e956adf5de3e8a3334e0b6820547b5772f71c49ae083",
233
+ "https://deno.land/std@0.202.0/fs/ensure_link.ts": "c15e69c48556d78aae31b83e0c0ece04b7b8bc0951412f5b759aceb6fde7f0ac",
234
+ "https://deno.land/std@0.202.0/fs/ensure_symlink.ts": "b389c8568f0656d145ac7ece472afe710815cccbb2ebfd19da7978379ae143fe",
235
+ "https://deno.land/std@0.202.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842",
236
+ "https://deno.land/std@0.202.0/fs/exists.ts": "cb59a853d84871d87acab0e7936a4dac11282957f8e195102c5a7acb42546bb8",
237
+ "https://deno.land/std@0.202.0/fs/expand_glob.ts": "52b8b6f5b1fa585c348250da1c80ce5d820746cb4a75d874b3599646f677d3a7",
238
+ "https://deno.land/std@0.202.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898",
239
+ "https://deno.land/std@0.202.0/fs/move.ts": "b4f8f46730b40c32ea3c0bc8eb0fd0e8139249a698883c7b3756424cf19785c9",
240
+ "https://deno.land/std@0.202.0/fs/walk.ts": "a16146724a6aaf9efdb92023a74e9805195c3469900744ce5de4113b07b29779",
241
+ "https://deno.land/std@0.202.0/path/_basename.ts": "057d420c9049821f983f784fd87fa73ac471901fb628920b67972b0f44319343",
242
+ "https://deno.land/std@0.202.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0",
243
+ "https://deno.land/std@0.202.0/path/_dirname.ts": "355e297236b2218600aee7a5301b937204c62e12da9db4b0b044993d9e658395",
244
+ "https://deno.land/std@0.202.0/path/_extname.ts": "eaaa5aae1acf1f03254d681bd6a8ce42a9cb5b7ff2213a9d4740e8ab31283664",
245
+ "https://deno.land/std@0.202.0/path/_format.ts": "4a99270d6810f082e614309164fad75d6f1a483b68eed97c830a506cc589f8b4",
246
+ "https://deno.land/std@0.202.0/path/_from_file_url.ts": "6eadfae2e6f63ad9ee46b26db4a1b16583055c0392acedfb50ed2fc694b6f581",
247
+ "https://deno.land/std@0.202.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b",
248
+ "https://deno.land/std@0.202.0/path/_is_absolute.ts": "05dac10b5e93c63198b92e3687baa2be178df5321c527dc555266c0f4f51558c",
249
+ "https://deno.land/std@0.202.0/path/_join.ts": "815f5e85b042285175b1492dd5781240ce126c23bd97bad6b8211fe7129c538e",
250
+ "https://deno.land/std@0.202.0/path/_normalize.ts": "a19ec8706b2707f9dd974662a5cd89fad438e62ab1857e08b314a8eb49a34d81",
251
+ "https://deno.land/std@0.202.0/path/_os.ts": "30b0c2875f360c9296dbe6b7f2d528f0f9c741cecad2e97f803f5219e91b40a2",
252
+ "https://deno.land/std@0.202.0/path/_parse.ts": "0f9b0ff43682dd9964eb1c4398610c4e165d8db9d3ac9d594220217adf480cfa",
253
+ "https://deno.land/std@0.202.0/path/_relative.ts": "27bdeffb5311a47d85be26d37ad1969979359f7636c5cd9fcf05dcd0d5099dc5",
254
+ "https://deno.land/std@0.202.0/path/_resolve.ts": "7a3616f1093735ed327e758313b79c3c04ea921808ca5f19ddf240cb68d0adf6",
255
+ "https://deno.land/std@0.202.0/path/_to_file_url.ts": "a141e4a525303e1a3a0c0571fd024552b5f3553a2af7d75d1ff3a503dcbb66d8",
256
+ "https://deno.land/std@0.202.0/path/_to_namespaced_path.ts": "0d5f4caa2ed98ef7a8786286df6af804b50e38859ae897b5b5b4c8c5930a75c8",
257
+ "https://deno.land/std@0.202.0/path/_util.ts": "4e191b1bac6b3bf0c31aab42e5ca2e01a86ab5a0d2e08b75acf8585047a86221",
258
+ "https://deno.land/std@0.202.0/path/basename.ts": "bdfa5a624c6a45564dc6758ef2077f2822978a6dbe77b0a3514f7d1f81362930",
259
+ "https://deno.land/std@0.202.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000",
260
+ "https://deno.land/std@0.202.0/path/dirname.ts": "b6533f4ee4174a526dec50c279534df5345836dfdc15318400b08c62a62a39dd",
261
+ "https://deno.land/std@0.202.0/path/extname.ts": "62c4b376300795342fe1e4746c0de518b4dc9c4b0b4617bfee62a2973a9555cf",
262
+ "https://deno.land/std@0.202.0/path/format.ts": "110270b238514dd68455a4c54956215a1aff7e37e22e4427b7771cefe1920aa5",
263
+ "https://deno.land/std@0.202.0/path/from_file_url.ts": "9f5cb58d58be14c775ec2e57fc70029ac8b17ed3bd7fe93e475b07280adde0ac",
264
+ "https://deno.land/std@0.202.0/path/glob.ts": "593e2c3573883225c25c5a21aaa8e9382a696b8e175ea20a3b6a1471ad17aaed",
265
+ "https://deno.land/std@0.202.0/path/is_absolute.ts": "0b92eb35a0a8780e9f16f16bb23655b67dace6a8e0d92d42039e518ee38103c1",
266
+ "https://deno.land/std@0.202.0/path/join.ts": "31c5419f23d91655b08ec7aec403f4e4cd1a63d39e28f6e42642ea207c2734f8",
267
+ "https://deno.land/std@0.202.0/path/mod.ts": "6e1efb0b13121463aedb53ea51dabf5639a3172ab58c89900bbb72b486872532",
268
+ "https://deno.land/std@0.202.0/path/normalize.ts": "6ea523e0040979dd7ae2f1be5bf2083941881a252554c0f32566a18b03021955",
269
+ "https://deno.land/std@0.202.0/path/parse.ts": "be8de342bb9e1924d78dc4d93c45215c152db7bf738ec32475560424b119b394",
270
+ "https://deno.land/std@0.202.0/path/posix.ts": "0a1c1952d132323a88736d03e92bd236f3ed5f9f079e5823fae07c8d978ee61b",
271
+ "https://deno.land/std@0.202.0/path/relative.ts": "8bedac226afd360afc45d451a6c29fabceaf32978526bcb38e0c852661f66c61",
272
+ "https://deno.land/std@0.202.0/path/resolve.ts": "133161e4949fc97f9ca67988d51376b0f5eef8968a6372325ab84d39d30b80dc",
273
+ "https://deno.land/std@0.202.0/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f",
274
+ "https://deno.land/std@0.202.0/path/to_file_url.ts": "00e6322373dd51ad109956b775e4e72e5f9fa68ce2c6b04e4af2a6eed3825d31",
275
+ "https://deno.land/std@0.202.0/path/to_namespaced_path.ts": "1b1db3055c343ab389901adfbda34e82b7386bcd1c744d54f9c1496ee0fd0c3d",
276
+ "https://deno.land/std@0.202.0/path/win32.ts": "8b3f80ef7a462511d5e8020ff490edcaa0a0d118f1b1e9da50e2916bdd73f9dd",
277
+ "https://deno.land/x/chdir_anywhere@v0.0.2/mod.js": "2b460dcfb6d9946853830034b2efa248fe3229c9ddb8a9bd9affc7114e202055",
278
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/mod.js": "8250c61209782c44f4fae53d1c9c985ae0c75733723b3fa80bca0b1f26947424",
279
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/src/collectImports.js": "e543796d352c8921c2822a375f0f760530f8344ac5ef80784c3e8601b44a4fca",
280
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/src/common.js": "1e44aa3ef698cf34016df7c50f1ed3f825441049039c6df00e96316b3152f682",
281
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/src/logging.js": "16c0ad07917014e315fb6e08a84fc6fe0a09de776b2ce7d911599f9e8c1b3458",
282
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/src/modifyVendoredFiles.js": "8b53e569bf11a314398c0a55ec957f9dcf5b1d5c1c72c26de40c4e54238c9418",
283
+ "https://deno.land/x/deno_tsc_helper@v0.7.0/src/parseFileAst.js": "da4f26d1b4bfe8a2b7f8d05c4f1be27dfd5729d5015859ca1c1d639a407501b7",
284
+ "https://deno.land/x/import_maps@v0.1.1/mod.js": "1b87297e3987ca2ea9c9461e33775575c9dc92ec326fefa666a548b1c19550b7",
285
+ "https://deno.land/x/npm_fetcher@v0.1.0/mod.ts": "b854c1d8f118c2b46a727bc807f9d0c89a1cef4d20e5623be166ebbdefab558f",
286
+ "https://deno.land/x/vendor@v0.2.0/mod.js": "5e7a60f2d6db22417e41da5967b590493c53d146afc28f5f1caf0c2e705bef84",
287
+ "https://deno.land/x/vendor@v0.2.0/src/fetchDependencies.js": "576be162bd32603ec552df143a6ff2ac2ee59a2b8e66fdfbb393493dea4caf30",
288
+ "https://deno.land/x/vendor@v0.2.0/src/parseImportSpecifiers.js": "e9573274894eceaf728fa0f0b5eff791f089a4589661f5a1638bddd5898f3847",
289
+ "https://deno.land/x/vendor@v0.2.0/src/vendor.js": "8c256b368bf31e76400c670c36b50d1fced050c4ac6c82e27ee08f2b450ac332"
290
+ },
291
+ "workspace": {
292
+ "dependencies": [
293
+ "npm:@adlad/adlad@1.0.0"
294
+ ]
295
+ }
296
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @param {Object} options
3
+ * @param {string} options.appId
4
+ * @param {string | undefined} [options.domain]
5
+ * @param {string | undefined} [options.cookieDomain]
6
+ */
7
+ export function viversePlugin({ appId, domain, cookieDomain, }: {
8
+ appId: string;
9
+ domain?: string | undefined;
10
+ cookieDomain?: string | undefined;
11
+ }): {
12
+ readonly name: "viverse";
13
+ readonly initialize: (ctx: any) => Promise<void>;
14
+ readonly customRequests: {
15
+ /**
16
+ * @param {string} key
17
+ * @param {unknown} value
18
+ */
19
+ readonly setStorageItem: (key: string, value: unknown) => Promise<void>;
20
+ /**
21
+ * @param {string} key
22
+ * @returns {Promise<unknown>}
23
+ */
24
+ readonly getStorageItem: (key: string) => Promise<unknown>;
25
+ readonly showAuthPrompt: () => void;
26
+ };
27
+ };
@@ -0,0 +1 @@
1
+ function viversePlugin({appId:e,domain:t="account.htcvive.com",cookieDomain:a}){let i=!1;if(!e)throw new Error("No app id was provided");const o={viverse:"viverse",client:"client",clientId:"clientId",domain:"domain",cookieDomain:"cookieDomain",checkAuth:"checkAuth",loginWithWorlds:"loginWithWorlds",storage:"storage",newCloudSaveClient:"newCloudSaveClient",setPlayerData:"setPlayerData",getPlayerData:"getPlayerData"};let n,s;o>0&&console.log(o);let l=null;const r=new Map,c="adlad_viverse_";return{name:"viverse",async initialize(r){if(i)throw new Error("Viverse plugin is being initialized more than once");i=!0,await r.loadScriptTag("https://www.viverse.com/static-assets/viverse-sdk/index.umd.cjs"),n=new globalThis[o.viverse][o.client]({[o.clientId]:e,[o.domain]:t,[o.cookieDomain]:a});const c=await n[o.checkAuth]();l=c?.access_token||null;const v=new globalThis[o.viverse][o.storage];s=await v[o.newCloudSaveClient](e)},customRequests:{async setStorageItem(e,t){const a=JSON.stringify(t);if(l)await s[o.setPlayerData](e,a,l);else try{localStorage.setItem(c+e,a)}catch{r.set(e,a)}},async getStorageItem(e){let t;if(l)t=await s[o.getPlayerData](e,l);else try{t=localStorage.getItem(c+e)}catch{t=r.get(e)}return t&&"string"==typeof t?JSON.parse(t):null},showAuthPrompt(){n[o.loginWithWorlds]()}}}}export{viversePlugin};
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "checkJs": true,
5
+ "module": "esnext",
6
+ "strict": true,
7
+ "declaration": true,
8
+ "emitDeclarationOnly": true
9
+ },
10
+ "files": ["mod.js"]
11
+ }
package/importmap.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "imports": {
3
+ "$std/": "https://deno.land/std@0.178.0/",
4
+ "$chdir_anywhere": "https://deno.land/x/chdir_anywhere@v0.0.2/mod.js",
5
+ "$adlad": "npm:@adlad/adlad@1.0.0"
6
+ }
7
+ }
package/jsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "extends": "./.denoTypes/tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext", "WebWorker"],
5
+ "target": "esnext",
6
+ "checkJs": true,
7
+ "module": "esnext",
8
+ "useDefineForClassFields": true,
9
+ "strict": true
10
+ },
11
+ "include": [
12
+ "src/**/*.js",
13
+ "src/**/*.ts",
14
+ "test",
15
+ "scripts"
16
+ ],
17
+ "files": [
18
+ "mod.js"
19
+ ]
20
+ }
package/mod.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/mod.js";
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@adlad/plugin-viverse",
3
+ "version": "0.1.0",
4
+ "description": "AdLad plugin for the Viverse sdk.",
5
+ "main": "mod.js",
6
+ "types": "dist/adlad-plugin-viverse.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Pelican-Party/adlad-plugin-viverse.git"
10
+ },
11
+ "keywords": [
12
+ "ads"
13
+ ],
14
+ "author": "Pelican Party Studios",
15
+ "license": "MIT",
16
+ "bugs": {
17
+ "url": "https://github.com/Pelican-Party/adlad-plugin-viverse/issues"
18
+ },
19
+ "homepage": "https://github.com/Pelican-Party/adlad-plugin-viverse#readme"
20
+ }
package/src/mod.js ADDED
@@ -0,0 +1,123 @@
1
+ /**
2
+ * @param {Object} options
3
+ * @param {string} options.appId
4
+ * @param {string | undefined} [options.domain]
5
+ * @param {string | undefined} [options.cookieDomain]
6
+ */
7
+ export function viversePlugin({
8
+ appId,
9
+ domain = "account.htcvive.com",
10
+ cookieDomain = undefined,
11
+ }) {
12
+ let initializeCalled = false;
13
+
14
+ if (!appId) {
15
+ throw new Error("No app id was provided");
16
+ }
17
+
18
+ const props = /** @type {const} */ ({
19
+ viverse: "viverse",
20
+ client: "client",
21
+ clientId: "clientId",
22
+ domain: "domain",
23
+ cookieDomain: "cookieDomain",
24
+ checkAuth: "checkAuth",
25
+ loginWithWorlds: "loginWithWorlds",
26
+ storage: "storage",
27
+ newCloudSaveClient: "newCloudSaveClient",
28
+ setPlayerData: "setPlayerData",
29
+ getPlayerData: "getPlayerData",
30
+ });
31
+
32
+ // @ts-ignore We want to make sure that `props` remains an object.
33
+ // Normally, terser would turn every property into a separate variable.
34
+ // This would be fine for the first pass of minification, but if a user
35
+ // were to bundle and minify this libarry with their own code, they will minify a second time
36
+ // causing all these props to lose their quotes.
37
+ // This can be an issue if the new bundle has property mangling enabled.
38
+ // This if statement will never run, but rollup and terser will both think it
39
+ // might and so the `props` opbject will remain an object.
40
+ if (props > 0) console.log(props);
41
+
42
+ /** @type {import("./types.d.ts").ViverseClient} */
43
+ let client;
44
+ /** @type {import("./types.d.ts").CloudSaveClient} */
45
+ let cloudSaveClient;
46
+ /** @type {string?} */
47
+ let accessToken = null;
48
+
49
+ /** @type {Map<string, string>} */
50
+ const sessionStorage = new Map();
51
+
52
+ // We add a prefix to localStorage keys to prevent clashes with manual calls to localStorage.setItem();
53
+ const localStoragePrefix = "adlad_viverse_";
54
+
55
+ const plugin = /** @type {const} @satisfies {import("$adlad").AdLadPlugin} */ ({
56
+ name: "viverse",
57
+ async initialize(ctx) {
58
+ if (initializeCalled) {
59
+ throw new Error("Viverse plugin is being initialized more than once");
60
+ }
61
+ initializeCalled = true;
62
+
63
+ await ctx.loadScriptTag("https://www.viverse.com/static-assets/viverse-sdk/index.umd.cjs");
64
+
65
+ client = new globalThis[props.viverse][props.client]({
66
+ [props.clientId]: appId,
67
+ [props.domain]: domain,
68
+ [props.cookieDomain]: cookieDomain,
69
+ });
70
+
71
+ const authResult = await client[props.checkAuth]();
72
+ accessToken = authResult?.access_token || null;
73
+
74
+ const storageClient = new globalThis[props.viverse][props.storage]();
75
+ cloudSaveClient = await storageClient[props.newCloudSaveClient](appId);
76
+ },
77
+ customRequests: {
78
+ /**
79
+ * @param {string} key
80
+ * @param {unknown} value
81
+ */
82
+ async setStorageItem(key, value) {
83
+ // The Viverse SDK doesn't allow passing raw values such as `true` or `42`,
84
+ // but since this is quite common, we'll add support for this by stringifying the provided value.
85
+ // This does mean the SDK will probably stringify it a second time, but oh well.
86
+ const stringifiedValue = JSON.stringify(value);
87
+ if (accessToken) {
88
+ await cloudSaveClient[props.setPlayerData](key, stringifiedValue, accessToken);
89
+ } else {
90
+ try {
91
+ localStorage.setItem(localStoragePrefix + key, stringifiedValue);
92
+ } catch {
93
+ // The user is probably using private browsing, we'll fallback to session storage
94
+ sessionStorage.set(key, stringifiedValue);
95
+ }
96
+ }
97
+ },
98
+ /**
99
+ * @param {string} key
100
+ * @returns {Promise<unknown>}
101
+ */
102
+ async getStorageItem(key) {
103
+ let stringifiedValue;
104
+ if (accessToken) {
105
+ stringifiedValue = await cloudSaveClient[props.getPlayerData](key, accessToken);
106
+ } else {
107
+ try {
108
+ stringifiedValue = localStorage.getItem(localStoragePrefix + key);
109
+ } catch {
110
+ stringifiedValue = sessionStorage.get(key);
111
+ }
112
+ }
113
+ if (!stringifiedValue || typeof stringifiedValue != "string") return null;
114
+ return JSON.parse(stringifiedValue);
115
+ },
116
+ showAuthPrompt() {
117
+ client[props.loginWithWorlds]();
118
+ },
119
+ },
120
+ });
121
+
122
+ return plugin;
123
+ }
package/src/types.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ declare global {
2
+ var viverse: {
3
+ client: typeof ViverseClient;
4
+ storage: typeof ViverseStorage;
5
+ };
6
+ }
7
+
8
+ interface ViverseClientOptions {
9
+ clientId: string;
10
+ domain?: string;
11
+ cookieDomain?: string;
12
+ }
13
+
14
+ interface UserInfo {
15
+ access_token: string;
16
+ account_id: string;
17
+ expires_in: number;
18
+ state: string;
19
+ }
20
+
21
+ export class ViverseClient {
22
+ constructor(options: ViverseClientOptions);
23
+
24
+ checkAuth(): Promise<UserInfo | undefined>;
25
+ loginWithWorlds(): void;
26
+ }
27
+
28
+ class ViverseStorage {
29
+ newCloudSaveClient(appId: string): Promise<CloudSaveClient>;
30
+ }
31
+
32
+ export class CloudSaveClient {
33
+ setPlayerData(key: string, value: unknown, accessToken: string): Promise<void>;
34
+ getPlayerData(key: string, accessToken: string): Promise<unknown>;
35
+ }
36
+
37
+ export {};