@apps-in-toss/plugins 1.9.4 → 1.10.1
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/dist/index.cjs +492 -446
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +509 -462
- package/dist/internal.cjs +128 -707
- package/dist/internal.js +140 -743
- package/package.json +4 -2
package/dist/internal.cjs
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
-
};
|
|
11
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
10
|
};
|
|
@@ -33,171 +30,61 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
30
|
));
|
|
34
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
32
|
|
|
36
|
-
//
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// ../../../.yarn/__virtual__/typia-virtual-6e1bbef80b/0/cache/typia-npm-9.7.2-987d15a303-1b19baddfe.zip/node_modules/typia/lib/internal/_createStandardSchema.js
|
|
92
|
-
var require_createStandardSchema = __commonJS({
|
|
93
|
-
"../../../.yarn/__virtual__/typia-virtual-6e1bbef80b/0/cache/typia-npm-9.7.2-987d15a303-1b19baddfe.zip/node_modules/typia/lib/internal/_createStandardSchema.js"(exports2) {
|
|
94
|
-
"use strict";
|
|
95
|
-
init_cjs_shims();
|
|
96
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
97
|
-
exports2._createStandardSchema = void 0;
|
|
98
|
-
var _createStandardSchema2 = (fn) => Object.assign(fn, {
|
|
99
|
-
"~standard": {
|
|
100
|
-
version: 1,
|
|
101
|
-
vendor: "typia",
|
|
102
|
-
validate: (input) => {
|
|
103
|
-
const result = fn(input);
|
|
104
|
-
if (result.success) {
|
|
105
|
-
return {
|
|
106
|
-
value: result.data
|
|
107
|
-
};
|
|
108
|
-
} else {
|
|
109
|
-
return {
|
|
110
|
-
issues: result.errors.map((error) => ({
|
|
111
|
-
message: `expected ${error.expected}, got ${error.value}`,
|
|
112
|
-
path: typiaPathToStandardSchemaPath(error.path)
|
|
113
|
-
}))
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
exports2._createStandardSchema = _createStandardSchema2;
|
|
120
|
-
var PathParserState;
|
|
121
|
-
(function(PathParserState2) {
|
|
122
|
-
PathParserState2[PathParserState2["Start"] = 0] = "Start";
|
|
123
|
-
PathParserState2[PathParserState2["Property"] = 1] = "Property";
|
|
124
|
-
PathParserState2[PathParserState2["StringKey"] = 2] = "StringKey";
|
|
125
|
-
PathParserState2[PathParserState2["NumberKey"] = 3] = "NumberKey";
|
|
126
|
-
})(PathParserState || (PathParserState = {}));
|
|
127
|
-
var typiaPathToStandardSchemaPath = (path9) => {
|
|
128
|
-
if (!path9.startsWith("$input")) {
|
|
129
|
-
throw new Error(`Invalid path: ${JSON.stringify(path9)}`);
|
|
130
|
-
}
|
|
131
|
-
const segments = [];
|
|
132
|
-
let currentSegment = "";
|
|
133
|
-
let state = PathParserState.Start;
|
|
134
|
-
let index = "$input".length - 1;
|
|
135
|
-
while (index < path9.length - 1) {
|
|
136
|
-
index++;
|
|
137
|
-
const char = path9[index];
|
|
138
|
-
if (state === PathParserState.Property) {
|
|
139
|
-
if (char === "." || char === "[") {
|
|
140
|
-
segments.push({
|
|
141
|
-
key: currentSegment
|
|
142
|
-
});
|
|
143
|
-
state = PathParserState.Start;
|
|
144
|
-
} else if (index === path9.length - 1) {
|
|
145
|
-
currentSegment += char;
|
|
146
|
-
segments.push({
|
|
147
|
-
key: currentSegment
|
|
148
|
-
});
|
|
149
|
-
index++;
|
|
150
|
-
state = PathParserState.Start;
|
|
151
|
-
} else {
|
|
152
|
-
currentSegment += char;
|
|
153
|
-
}
|
|
154
|
-
} else if (state === PathParserState.StringKey) {
|
|
155
|
-
if (char === '"') {
|
|
156
|
-
segments.push({
|
|
157
|
-
key: JSON.parse(currentSegment + char)
|
|
158
|
-
});
|
|
159
|
-
index += 2;
|
|
160
|
-
state = PathParserState.Start;
|
|
161
|
-
} else if (char === "\\") {
|
|
162
|
-
currentSegment += path9[index];
|
|
163
|
-
index++;
|
|
164
|
-
currentSegment += path9[index];
|
|
165
|
-
} else {
|
|
166
|
-
currentSegment += char;
|
|
167
|
-
}
|
|
168
|
-
} else if (state === PathParserState.NumberKey) {
|
|
169
|
-
if (char === "]") {
|
|
170
|
-
segments.push({
|
|
171
|
-
key: Number.parseInt(currentSegment)
|
|
172
|
-
});
|
|
173
|
-
index++;
|
|
174
|
-
state = PathParserState.Start;
|
|
175
|
-
} else {
|
|
176
|
-
currentSegment += char;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (state === PathParserState.Start && index < path9.length - 1) {
|
|
180
|
-
const newChar = path9[index];
|
|
181
|
-
currentSegment = "";
|
|
182
|
-
if (newChar === "[") {
|
|
183
|
-
if (path9[index + 1] === '"') {
|
|
184
|
-
state = PathParserState.StringKey;
|
|
185
|
-
index++;
|
|
186
|
-
currentSegment = '"';
|
|
187
|
-
} else {
|
|
188
|
-
state = PathParserState.NumberKey;
|
|
189
|
-
}
|
|
190
|
-
} else if (newChar === ".") {
|
|
191
|
-
state = PathParserState.Property;
|
|
192
|
-
} else {
|
|
193
|
-
throw new Error("Unreachable: pointer points invalid character");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
if (state !== PathParserState.Start) {
|
|
198
|
-
throw new Error(`Failed to parse path: ${JSON.stringify(path9)}`);
|
|
33
|
+
// package.json
|
|
34
|
+
var require_package = __commonJS({
|
|
35
|
+
"package.json"(exports2, module2) {
|
|
36
|
+
module2.exports = {
|
|
37
|
+
name: "@apps-in-toss/plugins",
|
|
38
|
+
type: "module",
|
|
39
|
+
version: "1.10.1",
|
|
40
|
+
description: "The plugins for Apps In Toss",
|
|
41
|
+
scripts: {
|
|
42
|
+
test: "vitest --run",
|
|
43
|
+
typecheck: "tsc --noEmit",
|
|
44
|
+
lint: "eslint .",
|
|
45
|
+
build: "tsup"
|
|
46
|
+
},
|
|
47
|
+
main: "./dist/index.cjs",
|
|
48
|
+
module: "./dist/index.js",
|
|
49
|
+
types: "./dist/index.d.ts",
|
|
50
|
+
exports: {
|
|
51
|
+
".": {
|
|
52
|
+
types: "./dist/index.d.ts",
|
|
53
|
+
import: "./dist/index.js",
|
|
54
|
+
require: "./dist/index.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./internal": {
|
|
57
|
+
types: "./dist/internal.d.ts",
|
|
58
|
+
import: "./dist/internal.js",
|
|
59
|
+
require: "./dist/internal.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
files: [
|
|
64
|
+
"dist/**/*"
|
|
65
|
+
],
|
|
66
|
+
devDependencies: {
|
|
67
|
+
"@ryoppippi/unplugin-typia": "^2.6.5",
|
|
68
|
+
"@types/archiver": "^6.0.3",
|
|
69
|
+
"@types/connect": "^3",
|
|
70
|
+
tsup: "^8.4.0",
|
|
71
|
+
typescript: "5.8.3",
|
|
72
|
+
typia: "^9.3.0",
|
|
73
|
+
vitest: "^3.2.4"
|
|
74
|
+
},
|
|
75
|
+
dependencies: {
|
|
76
|
+
"@apps-in-toss/ait-format": "^1.0.0",
|
|
77
|
+
"@granite-js/plugin-core": "0.1.31",
|
|
78
|
+
"@granite-js/plugin-micro-frontend": "0.1.31",
|
|
79
|
+
"@granite-js/plugin-sentry": "0.1.31",
|
|
80
|
+
"@granite-js/utils": "0.1.31",
|
|
81
|
+
archiver: "^7.0.1",
|
|
82
|
+
connect: "^3.7.0",
|
|
83
|
+
esbuild: "0.25.5",
|
|
84
|
+
execa: "9.3.0",
|
|
85
|
+
picocolors: "^1.1.1",
|
|
86
|
+
uuidv7: "^1.0.2"
|
|
199
87
|
}
|
|
200
|
-
return segments;
|
|
201
88
|
};
|
|
202
89
|
}
|
|
203
90
|
});
|
|
@@ -208,15 +95,16 @@ __export(internal_exports, {
|
|
|
208
95
|
appsInTossHost: () => appsInTossHost
|
|
209
96
|
});
|
|
210
97
|
module.exports = __toCommonJS(internal_exports);
|
|
211
|
-
|
|
98
|
+
|
|
99
|
+
// ../../../.yarn/__virtual__/tsup-virtual-dc9661456a/0/cache/tsup-npm-8.4.0-f78d2622c9-c6636ffd6a.zip/node_modules/tsup/assets/cjs_shims.js
|
|
100
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
101
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
212
102
|
|
|
213
103
|
// src/appsInTossHost.ts
|
|
214
|
-
init_cjs_shims();
|
|
215
104
|
var import_plugin_micro_frontend = require("@granite-js/plugin-micro-frontend");
|
|
216
105
|
var import_plugin_sentry = require("@granite-js/plugin-sentry");
|
|
217
106
|
|
|
218
107
|
// src/constants.ts
|
|
219
|
-
init_cjs_shims();
|
|
220
108
|
var REACT_NATIVE_VERSION = "0.72.6";
|
|
221
109
|
var APP_MANIFEST_NAME = "app.json";
|
|
222
110
|
var MICRO_FRONTEND_HOST_NAME = "apps-in-toss-host";
|
|
@@ -238,11 +126,7 @@ var SHRED_PACKAGES = [
|
|
|
238
126
|
"react-native-webview"
|
|
239
127
|
];
|
|
240
128
|
|
|
241
|
-
// src/plugins/index.ts
|
|
242
|
-
init_cjs_shims();
|
|
243
|
-
|
|
244
129
|
// src/plugins/appJson.ts
|
|
245
|
-
init_cjs_shims();
|
|
246
130
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
247
131
|
var import_path = __toESM(require("path"), 1);
|
|
248
132
|
var import_utils = require("@granite-js/utils");
|
|
@@ -284,14 +168,12 @@ async function appsInTossAppJson(options) {
|
|
|
284
168
|
}
|
|
285
169
|
|
|
286
170
|
// src/plugins/artifact.ts
|
|
287
|
-
init_cjs_shims();
|
|
288
171
|
var import_path3 = __toESM(require("path"), 1);
|
|
289
172
|
var import_plugin_core = require("@granite-js/plugin-core");
|
|
290
|
-
var
|
|
173
|
+
var import_utils2 = require("@granite-js/utils");
|
|
291
174
|
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
292
175
|
|
|
293
176
|
// src/log.ts
|
|
294
|
-
init_cjs_shims();
|
|
295
177
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
296
178
|
var TAG = import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]"));
|
|
297
179
|
function log(...args) {
|
|
@@ -299,7 +181,6 @@ function log(...args) {
|
|
|
299
181
|
}
|
|
300
182
|
|
|
301
183
|
// src/utils/collectDependencyVersions.ts
|
|
302
|
-
init_cjs_shims();
|
|
303
184
|
var fs2 = __toESM(require("fs/promises"), 1);
|
|
304
185
|
var path2 = __toESM(require("path"), 1);
|
|
305
186
|
var esbuild = __toESM(require("esbuild"), 1);
|
|
@@ -358,8 +239,8 @@ async function resolvePackageVersions(rootDir, packageNames) {
|
|
|
358
239
|
function createVirtualEntry(packageNames) {
|
|
359
240
|
return packageNames.map((packageName) => `import '${packageName}';`).join("\n");
|
|
360
241
|
}
|
|
361
|
-
function extractPackagePath(
|
|
362
|
-
const normalizedPath = normalizePath(
|
|
242
|
+
function extractPackagePath(path7, packageName) {
|
|
243
|
+
const normalizedPath = normalizePath(path7);
|
|
363
244
|
if (normalizedPath.endsWith("/package.json")) {
|
|
364
245
|
return normalizedPath.replace(/\/package\.json$/, "");
|
|
365
246
|
}
|
|
@@ -369,8 +250,8 @@ function extractPackagePath(path9, packageName) {
|
|
|
369
250
|
}
|
|
370
251
|
throw new Error(`Failed to extract path: ${packageName}`);
|
|
371
252
|
}
|
|
372
|
-
function normalizePath(
|
|
373
|
-
return
|
|
253
|
+
function normalizePath(path7) {
|
|
254
|
+
return path7.replace(/\\/g, "/");
|
|
374
255
|
}
|
|
375
256
|
async function getPackageVersion(packagePath) {
|
|
376
257
|
const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
|
|
@@ -378,530 +259,69 @@ async function getPackageVersion(packagePath) {
|
|
|
378
259
|
}
|
|
379
260
|
|
|
380
261
|
// src/utils/createArtifact.ts
|
|
381
|
-
|
|
262
|
+
var fs3 = __toESM(require("fs/promises"), 1);
|
|
382
263
|
var import_path2 = __toESM(require("path"), 1);
|
|
383
|
-
var
|
|
384
|
-
|
|
385
|
-
// src/utils/compressToZip.ts
|
|
386
|
-
init_cjs_shims();
|
|
387
|
-
var fs3 = __toESM(require("fs"), 1);
|
|
388
|
-
var path3 = __toESM(require("path"), 1);
|
|
389
|
-
var import_archiver = __toESM(require("archiver"), 1);
|
|
390
|
-
async function compressToZip(config) {
|
|
391
|
-
const { files, outfile } = config;
|
|
392
|
-
return new Promise((resolve, reject) => {
|
|
393
|
-
const outputStream = fs3.createWriteStream(outfile);
|
|
394
|
-
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
395
|
-
outputStream.on("close", () => resolve(outfile));
|
|
396
|
-
outputStream.on("error", (error) => reject(error));
|
|
397
|
-
archive.on("error", (error) => reject(error)).pipe(outputStream);
|
|
398
|
-
files.forEach(({ path: filePath, name }) => {
|
|
399
|
-
const fileName = name ?? path3.basename(filePath);
|
|
400
|
-
archive.append(fs3.createReadStream(filePath), { name: fileName });
|
|
401
|
-
});
|
|
402
|
-
archive.finalize();
|
|
403
|
-
});
|
|
404
|
-
}
|
|
264
|
+
var import_ait_format = require("@apps-in-toss/ait-format");
|
|
405
265
|
|
|
406
|
-
// src/utils/
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
async function readAppJson(appJsonPath) {
|
|
418
|
-
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
419
|
-
return JSON.parse(appJson);
|
|
420
|
-
}
|
|
421
|
-
async function writeAppJson(appJsonPath, content) {
|
|
422
|
-
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
423
|
-
}
|
|
424
|
-
async function updateAppJsonMetadata(metadata) {
|
|
425
|
-
const appJsonPath = await resolveAppManifestPath();
|
|
426
|
-
const appJson = await readAppJson(appJsonPath);
|
|
427
|
-
await writeAppJson(appJsonPath, {
|
|
428
|
-
...appJson,
|
|
429
|
-
_metadata: metadata
|
|
430
|
-
});
|
|
266
|
+
// src/utils/getUnityMetaDataEnv.ts
|
|
267
|
+
function getUnityMetaDataEnv() {
|
|
268
|
+
const metaData = process.env.UNITY_METADATA;
|
|
269
|
+
if (!metaData) return {};
|
|
270
|
+
try {
|
|
271
|
+
return JSON.parse(metaData);
|
|
272
|
+
} catch (e) {
|
|
273
|
+
console.warn("UNITY_METADATA is not a valid JSON:", e);
|
|
274
|
+
return {};
|
|
275
|
+
}
|
|
431
276
|
}
|
|
432
277
|
|
|
433
|
-
// src/types.ts
|
|
434
|
-
init_cjs_shims();
|
|
435
|
-
var __typia_transform__isFormatUuid = __toESM(require_isFormatUuid(), 1);
|
|
436
|
-
var __typia_transform__validateReport = __toESM(require_validateReport(), 1);
|
|
437
|
-
var __typia_transform__createStandardSchema = __toESM(require_createStandardSchema(), 1);
|
|
438
|
-
var validateAppManifest = (() => {
|
|
439
|
-
const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input._metadata && null !== input._metadata && _io6(input._metadata));
|
|
440
|
-
const _io1 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
|
|
441
|
-
const _io2 = (input) => "geolocation" === input.name && "access" === input.access;
|
|
442
|
-
const _io3 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
|
|
443
|
-
const _io4 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
|
|
444
|
-
const _io5 = (input) => "camera" === input.name && "access" === input.access;
|
|
445
|
-
const _io6 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
|
|
446
|
-
const _iu0 = (input) => (() => {
|
|
447
|
-
if ("camera" === input.name)
|
|
448
|
-
return _io5(input);
|
|
449
|
-
else if ("photos" === input.name)
|
|
450
|
-
return _io4(input);
|
|
451
|
-
else if ("contacts" === input.name)
|
|
452
|
-
return _io3(input);
|
|
453
|
-
else if ("geolocation" === input.name)
|
|
454
|
-
return _io2(input);
|
|
455
|
-
else if ("clipboard" === input.name)
|
|
456
|
-
return _io1(input);
|
|
457
|
-
else
|
|
458
|
-
return false;
|
|
459
|
-
})();
|
|
460
|
-
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.appName || _report(_exceptionable, {
|
|
461
|
-
path: _path + ".appName",
|
|
462
|
-
expected: "string",
|
|
463
|
-
value: input.appName
|
|
464
|
-
}), (Array.isArray(input.permissions) || _report(_exceptionable, {
|
|
465
|
-
path: _path + ".permissions",
|
|
466
|
-
expected: "Array<Permission>",
|
|
467
|
-
value: input.permissions
|
|
468
|
-
})) && input.permissions.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
469
|
-
path: _path + ".permissions[" + _index3 + "]",
|
|
470
|
-
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
471
|
-
value: elem
|
|
472
|
-
})) && _vu0(elem, _path + ".permissions[" + _index3 + "]", _exceptionable) || _report(_exceptionable, {
|
|
473
|
-
path: _path + ".permissions[" + _index3 + "]",
|
|
474
|
-
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
475
|
-
value: elem
|
|
476
|
-
})).every((flag) => flag) || _report(_exceptionable, {
|
|
477
|
-
path: _path + ".permissions",
|
|
478
|
-
expected: "Array<Permission>",
|
|
479
|
-
value: input.permissions
|
|
480
|
-
}), ("object" === typeof input._metadata && null !== input._metadata || _report(_exceptionable, {
|
|
481
|
-
path: _path + "._metadata",
|
|
482
|
-
expected: "__type",
|
|
483
|
-
value: input._metadata
|
|
484
|
-
})) && _vo6(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
|
|
485
|
-
path: _path + "._metadata",
|
|
486
|
-
expected: "__type",
|
|
487
|
-
value: input._metadata
|
|
488
|
-
})].every((flag) => flag);
|
|
489
|
-
const _vo1 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
|
|
490
|
-
path: _path + ".name",
|
|
491
|
-
expected: '"clipboard"',
|
|
492
|
-
value: input.name
|
|
493
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
494
|
-
path: _path + ".access",
|
|
495
|
-
expected: '("read" | "write")',
|
|
496
|
-
value: input.access
|
|
497
|
-
})].every((flag) => flag);
|
|
498
|
-
const _vo2 = (input, _path, _exceptionable = true) => ["geolocation" === input.name || _report(_exceptionable, {
|
|
499
|
-
path: _path + ".name",
|
|
500
|
-
expected: '"geolocation"',
|
|
501
|
-
value: input.name
|
|
502
|
-
}), "access" === input.access || _report(_exceptionable, {
|
|
503
|
-
path: _path + ".access",
|
|
504
|
-
expected: '"access"',
|
|
505
|
-
value: input.access
|
|
506
|
-
})].every((flag) => flag);
|
|
507
|
-
const _vo3 = (input, _path, _exceptionable = true) => ["contacts" === input.name || _report(_exceptionable, {
|
|
508
|
-
path: _path + ".name",
|
|
509
|
-
expected: '"contacts"',
|
|
510
|
-
value: input.name
|
|
511
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
512
|
-
path: _path + ".access",
|
|
513
|
-
expected: '("read" | "write")',
|
|
514
|
-
value: input.access
|
|
515
|
-
})].every((flag) => flag);
|
|
516
|
-
const _vo4 = (input, _path, _exceptionable = true) => ["photos" === input.name || _report(_exceptionable, {
|
|
517
|
-
path: _path + ".name",
|
|
518
|
-
expected: '"photos"',
|
|
519
|
-
value: input.name
|
|
520
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
521
|
-
path: _path + ".access",
|
|
522
|
-
expected: '("read" | "write")',
|
|
523
|
-
value: input.access
|
|
524
|
-
})].every((flag) => flag);
|
|
525
|
-
const _vo5 = (input, _path, _exceptionable = true) => ["camera" === input.name || _report(_exceptionable, {
|
|
526
|
-
path: _path + ".name",
|
|
527
|
-
expected: '"camera"',
|
|
528
|
-
value: input.name
|
|
529
|
-
}), "access" === input.access || _report(_exceptionable, {
|
|
530
|
-
path: _path + ".access",
|
|
531
|
-
expected: '"access"',
|
|
532
|
-
value: input.access
|
|
533
|
-
})].every((flag) => flag);
|
|
534
|
-
const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
|
|
535
|
-
path: _path + ".bundleFiles",
|
|
536
|
-
expected: "Array<string>",
|
|
537
|
-
value: input.bundleFiles
|
|
538
|
-
})) && input.bundleFiles.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
|
|
539
|
-
path: _path + ".bundleFiles[" + _index4 + "]",
|
|
540
|
-
expected: "string",
|
|
541
|
-
value: elem
|
|
542
|
-
})).every((flag) => flag) || _report(_exceptionable, {
|
|
543
|
-
path: _path + ".bundleFiles",
|
|
544
|
-
expected: "Array<string>",
|
|
545
|
-
value: input.bundleFiles
|
|
546
|
-
}), "string" === typeof input.deploymentId && (__typia_transform__isFormatUuid._isFormatUuid(input.deploymentId) || _report(_exceptionable, {
|
|
547
|
-
path: _path + ".deploymentId",
|
|
548
|
-
expected: 'string & Format<"uuid">',
|
|
549
|
-
value: input.deploymentId
|
|
550
|
-
})) || _report(_exceptionable, {
|
|
551
|
-
path: _path + ".deploymentId",
|
|
552
|
-
expected: '(string & Format<"uuid">)',
|
|
553
|
-
value: input.deploymentId
|
|
554
|
-
})].every((flag) => flag);
|
|
555
|
-
const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
556
|
-
if ("camera" === input.name)
|
|
557
|
-
return _vo5(input, _path, _exceptionable);
|
|
558
|
-
else if ("photos" === input.name)
|
|
559
|
-
return _vo4(input, _path, _exceptionable);
|
|
560
|
-
else if ("contacts" === input.name)
|
|
561
|
-
return _vo3(input, _path, _exceptionable);
|
|
562
|
-
else if ("geolocation" === input.name)
|
|
563
|
-
return _vo2(input, _path, _exceptionable);
|
|
564
|
-
else if ("clipboard" === input.name)
|
|
565
|
-
return _vo1(input, _path, _exceptionable);
|
|
566
|
-
else
|
|
567
|
-
return _report(_exceptionable, {
|
|
568
|
-
path: _path,
|
|
569
|
-
expected: "(CameraPermission | PhotosPermission | ContactsPermission | GeolocationPermission | ClipboardPermission)",
|
|
570
|
-
value: input
|
|
571
|
-
});
|
|
572
|
-
})();
|
|
573
|
-
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
574
|
-
let errors;
|
|
575
|
-
let _report;
|
|
576
|
-
return __typia_transform__createStandardSchema._createStandardSchema((input) => {
|
|
577
|
-
if (false === __is(input)) {
|
|
578
|
-
errors = [];
|
|
579
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
580
|
-
((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
|
|
581
|
-
path: _path + "",
|
|
582
|
-
expected: "AppManifest",
|
|
583
|
-
value: input2
|
|
584
|
-
})) && _vo0(input2, _path + "", true) || _report(true, {
|
|
585
|
-
path: _path + "",
|
|
586
|
-
expected: "AppManifest",
|
|
587
|
-
value: input2
|
|
588
|
-
}))(input, "$input", true);
|
|
589
|
-
const success = 0 === errors.length;
|
|
590
|
-
return success ? {
|
|
591
|
-
success,
|
|
592
|
-
data: input
|
|
593
|
-
} : {
|
|
594
|
-
success,
|
|
595
|
-
errors,
|
|
596
|
-
data: input
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
return {
|
|
600
|
-
success: true,
|
|
601
|
-
data: input
|
|
602
|
-
};
|
|
603
|
-
});
|
|
604
|
-
})();
|
|
605
|
-
var validateAppInTossPluginOptions = (() => {
|
|
606
|
-
const _io0 = (input) => (void 0 === input.appType || "general" === input.appType || "game" === input.appType) && ("object" === typeof input.brand && null !== input.brand && _io1(input.brand)) && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && (void 0 === input.navigationBar || "object" === typeof input.navigationBar && null !== input.navigationBar && false === Array.isArray(input.navigationBar) && _io7(input.navigationBar));
|
|
607
|
-
const _io1 = (input) => "string" === typeof input.displayName && "string" === typeof input.primaryColor && "string" === typeof input.icon;
|
|
608
|
-
const _io2 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
|
|
609
|
-
const _io3 = (input) => "geolocation" === input.name && "access" === input.access;
|
|
610
|
-
const _io4 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
|
|
611
|
-
const _io5 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
|
|
612
|
-
const _io6 = (input) => "camera" === input.name && "access" === input.access;
|
|
613
|
-
const _io7 = (input) => (void 0 === input.withBackButton || "boolean" === typeof input.withBackButton) && (void 0 === input.withHomeButton || "boolean" === typeof input.withHomeButton) && (void 0 === input.initialAccessoryButton || "object" === typeof input.initialAccessoryButton && null !== input.initialAccessoryButton && _io8(input.initialAccessoryButton));
|
|
614
|
-
const _io8 = (input) => "string" === typeof input.id && "string" === typeof input.title && ("object" === typeof input.icon && null !== input.icon && _iu1(input.icon));
|
|
615
|
-
const _io9 = (input) => "object" === typeof input.source && null !== input.source && _io10(input.source) && (null !== input.name && void 0 === input.name);
|
|
616
|
-
const _io10 = (input) => "string" === typeof input.uri;
|
|
617
|
-
const _io11 = (input) => "string" === typeof input.name && (null !== input.source && void 0 === input.source);
|
|
618
|
-
const _iu0 = (input) => (() => {
|
|
619
|
-
if ("camera" === input.name)
|
|
620
|
-
return _io6(input);
|
|
621
|
-
else if ("photos" === input.name)
|
|
622
|
-
return _io5(input);
|
|
623
|
-
else if ("contacts" === input.name)
|
|
624
|
-
return _io4(input);
|
|
625
|
-
else if ("geolocation" === input.name)
|
|
626
|
-
return _io3(input);
|
|
627
|
-
else if ("clipboard" === input.name)
|
|
628
|
-
return _io2(input);
|
|
629
|
-
else
|
|
630
|
-
return false;
|
|
631
|
-
})();
|
|
632
|
-
const _iu1 = (input) => (() => {
|
|
633
|
-
if ("string" === typeof input.name)
|
|
634
|
-
return _io11(input);
|
|
635
|
-
else if ("object" === typeof input.source && null !== input.source && _io10(input.source))
|
|
636
|
-
return _io9(input);
|
|
637
|
-
else
|
|
638
|
-
return false;
|
|
639
|
-
})();
|
|
640
|
-
const _vo0 = (input, _path, _exceptionable = true) => [void 0 === input.appType || "general" === input.appType || "game" === input.appType || _report(_exceptionable, {
|
|
641
|
-
path: _path + ".appType",
|
|
642
|
-
expected: '("game" | "general" | undefined)',
|
|
643
|
-
value: input.appType
|
|
644
|
-
}), ("object" === typeof input.brand && null !== input.brand || _report(_exceptionable, {
|
|
645
|
-
path: _path + ".brand",
|
|
646
|
-
expected: "__type",
|
|
647
|
-
value: input.brand
|
|
648
|
-
})) && _vo1(input.brand, _path + ".brand", _exceptionable) || _report(_exceptionable, {
|
|
649
|
-
path: _path + ".brand",
|
|
650
|
-
expected: "__type",
|
|
651
|
-
value: input.brand
|
|
652
|
-
}), (Array.isArray(input.permissions) || _report(_exceptionable, {
|
|
653
|
-
path: _path + ".permissions",
|
|
654
|
-
expected: "Array<Permission>",
|
|
655
|
-
value: input.permissions
|
|
656
|
-
})) && input.permissions.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
657
|
-
path: _path + ".permissions[" + _index2 + "]",
|
|
658
|
-
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
659
|
-
value: elem
|
|
660
|
-
})) && _vu0(elem, _path + ".permissions[" + _index2 + "]", _exceptionable) || _report(_exceptionable, {
|
|
661
|
-
path: _path + ".permissions[" + _index2 + "]",
|
|
662
|
-
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
663
|
-
value: elem
|
|
664
|
-
})).every((flag) => flag) || _report(_exceptionable, {
|
|
665
|
-
path: _path + ".permissions",
|
|
666
|
-
expected: "Array<Permission>",
|
|
667
|
-
value: input.permissions
|
|
668
|
-
}), void 0 === input.navigationBar || ("object" === typeof input.navigationBar && null !== input.navigationBar && false === Array.isArray(input.navigationBar) || _report(_exceptionable, {
|
|
669
|
-
path: _path + ".navigationBar",
|
|
670
|
-
expected: "(__type.o1 | undefined)",
|
|
671
|
-
value: input.navigationBar
|
|
672
|
-
})) && _vo7(input.navigationBar, _path + ".navigationBar", _exceptionable) || _report(_exceptionable, {
|
|
673
|
-
path: _path + ".navigationBar",
|
|
674
|
-
expected: "(__type.o1 | undefined)",
|
|
675
|
-
value: input.navigationBar
|
|
676
|
-
})].every((flag) => flag);
|
|
677
|
-
const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.displayName || _report(_exceptionable, {
|
|
678
|
-
path: _path + ".displayName",
|
|
679
|
-
expected: "string",
|
|
680
|
-
value: input.displayName
|
|
681
|
-
}), "string" === typeof input.primaryColor || _report(_exceptionable, {
|
|
682
|
-
path: _path + ".primaryColor",
|
|
683
|
-
expected: "string",
|
|
684
|
-
value: input.primaryColor
|
|
685
|
-
}), "string" === typeof input.icon || _report(_exceptionable, {
|
|
686
|
-
path: _path + ".icon",
|
|
687
|
-
expected: "string",
|
|
688
|
-
value: input.icon
|
|
689
|
-
})].every((flag) => flag);
|
|
690
|
-
const _vo2 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
|
|
691
|
-
path: _path + ".name",
|
|
692
|
-
expected: '"clipboard"',
|
|
693
|
-
value: input.name
|
|
694
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
695
|
-
path: _path + ".access",
|
|
696
|
-
expected: '("read" | "write")',
|
|
697
|
-
value: input.access
|
|
698
|
-
})].every((flag) => flag);
|
|
699
|
-
const _vo3 = (input, _path, _exceptionable = true) => ["geolocation" === input.name || _report(_exceptionable, {
|
|
700
|
-
path: _path + ".name",
|
|
701
|
-
expected: '"geolocation"',
|
|
702
|
-
value: input.name
|
|
703
|
-
}), "access" === input.access || _report(_exceptionable, {
|
|
704
|
-
path: _path + ".access",
|
|
705
|
-
expected: '"access"',
|
|
706
|
-
value: input.access
|
|
707
|
-
})].every((flag) => flag);
|
|
708
|
-
const _vo4 = (input, _path, _exceptionable = true) => ["contacts" === input.name || _report(_exceptionable, {
|
|
709
|
-
path: _path + ".name",
|
|
710
|
-
expected: '"contacts"',
|
|
711
|
-
value: input.name
|
|
712
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
713
|
-
path: _path + ".access",
|
|
714
|
-
expected: '("read" | "write")',
|
|
715
|
-
value: input.access
|
|
716
|
-
})].every((flag) => flag);
|
|
717
|
-
const _vo5 = (input, _path, _exceptionable = true) => ["photos" === input.name || _report(_exceptionable, {
|
|
718
|
-
path: _path + ".name",
|
|
719
|
-
expected: '"photos"',
|
|
720
|
-
value: input.name
|
|
721
|
-
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
722
|
-
path: _path + ".access",
|
|
723
|
-
expected: '("read" | "write")',
|
|
724
|
-
value: input.access
|
|
725
|
-
})].every((flag) => flag);
|
|
726
|
-
const _vo6 = (input, _path, _exceptionable = true) => ["camera" === input.name || _report(_exceptionable, {
|
|
727
|
-
path: _path + ".name",
|
|
728
|
-
expected: '"camera"',
|
|
729
|
-
value: input.name
|
|
730
|
-
}), "access" === input.access || _report(_exceptionable, {
|
|
731
|
-
path: _path + ".access",
|
|
732
|
-
expected: '"access"',
|
|
733
|
-
value: input.access
|
|
734
|
-
})].every((flag) => flag);
|
|
735
|
-
const _vo7 = (input, _path, _exceptionable = true) => [void 0 === input.withBackButton || "boolean" === typeof input.withBackButton || _report(_exceptionable, {
|
|
736
|
-
path: _path + ".withBackButton",
|
|
737
|
-
expected: "(boolean | undefined)",
|
|
738
|
-
value: input.withBackButton
|
|
739
|
-
}), void 0 === input.withHomeButton || "boolean" === typeof input.withHomeButton || _report(_exceptionable, {
|
|
740
|
-
path: _path + ".withHomeButton",
|
|
741
|
-
expected: "(boolean | undefined)",
|
|
742
|
-
value: input.withHomeButton
|
|
743
|
-
}), void 0 === input.initialAccessoryButton || ("object" === typeof input.initialAccessoryButton && null !== input.initialAccessoryButton || _report(_exceptionable, {
|
|
744
|
-
path: _path + ".initialAccessoryButton",
|
|
745
|
-
expected: "(InitialAccessoryButton | undefined)",
|
|
746
|
-
value: input.initialAccessoryButton
|
|
747
|
-
})) && _vo8(input.initialAccessoryButton, _path + ".initialAccessoryButton", _exceptionable) || _report(_exceptionable, {
|
|
748
|
-
path: _path + ".initialAccessoryButton",
|
|
749
|
-
expected: "(InitialAccessoryButton | undefined)",
|
|
750
|
-
value: input.initialAccessoryButton
|
|
751
|
-
})].every((flag) => flag);
|
|
752
|
-
const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || _report(_exceptionable, {
|
|
753
|
-
path: _path + ".id",
|
|
754
|
-
expected: "string",
|
|
755
|
-
value: input.id
|
|
756
|
-
}), "string" === typeof input.title || _report(_exceptionable, {
|
|
757
|
-
path: _path + ".title",
|
|
758
|
-
expected: "string",
|
|
759
|
-
value: input.title
|
|
760
|
-
}), ("object" === typeof input.icon && null !== input.icon || _report(_exceptionable, {
|
|
761
|
-
path: _path + ".icon",
|
|
762
|
-
expected: "(__type.o2 | __type.o4)",
|
|
763
|
-
value: input.icon
|
|
764
|
-
})) && _vu1(input.icon, _path + ".icon", _exceptionable) || _report(_exceptionable, {
|
|
765
|
-
path: _path + ".icon",
|
|
766
|
-
expected: "(__type.o2 | __type.o4)",
|
|
767
|
-
value: input.icon
|
|
768
|
-
})].every((flag) => flag);
|
|
769
|
-
const _vo9 = (input, _path, _exceptionable = true) => [("object" === typeof input.source && null !== input.source || _report(_exceptionable, {
|
|
770
|
-
path: _path + ".source",
|
|
771
|
-
expected: "__type.o3",
|
|
772
|
-
value: input.source
|
|
773
|
-
})) && _vo10(input.source, _path + ".source", _exceptionable) || _report(_exceptionable, {
|
|
774
|
-
path: _path + ".source",
|
|
775
|
-
expected: "__type.o3",
|
|
776
|
-
value: input.source
|
|
777
|
-
}), (null !== input.name || _report(_exceptionable, {
|
|
778
|
-
path: _path + ".name",
|
|
779
|
-
expected: "undefined",
|
|
780
|
-
value: input.name
|
|
781
|
-
})) && (void 0 === input.name || _report(_exceptionable, {
|
|
782
|
-
path: _path + ".name",
|
|
783
|
-
expected: "undefined",
|
|
784
|
-
value: input.name
|
|
785
|
-
}))].every((flag) => flag);
|
|
786
|
-
const _vo10 = (input, _path, _exceptionable = true) => ["string" === typeof input.uri || _report(_exceptionable, {
|
|
787
|
-
path: _path + ".uri",
|
|
788
|
-
expected: "string",
|
|
789
|
-
value: input.uri
|
|
790
|
-
})].every((flag) => flag);
|
|
791
|
-
const _vo11 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
792
|
-
path: _path + ".name",
|
|
793
|
-
expected: "string",
|
|
794
|
-
value: input.name
|
|
795
|
-
}), (null !== input.source || _report(_exceptionable, {
|
|
796
|
-
path: _path + ".source",
|
|
797
|
-
expected: "undefined",
|
|
798
|
-
value: input.source
|
|
799
|
-
})) && (void 0 === input.source || _report(_exceptionable, {
|
|
800
|
-
path: _path + ".source",
|
|
801
|
-
expected: "undefined",
|
|
802
|
-
value: input.source
|
|
803
|
-
}))].every((flag) => flag);
|
|
804
|
-
const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
805
|
-
if ("camera" === input.name)
|
|
806
|
-
return _vo6(input, _path, _exceptionable);
|
|
807
|
-
else if ("photos" === input.name)
|
|
808
|
-
return _vo5(input, _path, _exceptionable);
|
|
809
|
-
else if ("contacts" === input.name)
|
|
810
|
-
return _vo4(input, _path, _exceptionable);
|
|
811
|
-
else if ("geolocation" === input.name)
|
|
812
|
-
return _vo3(input, _path, _exceptionable);
|
|
813
|
-
else if ("clipboard" === input.name)
|
|
814
|
-
return _vo2(input, _path, _exceptionable);
|
|
815
|
-
else
|
|
816
|
-
return _report(_exceptionable, {
|
|
817
|
-
path: _path,
|
|
818
|
-
expected: "(CameraPermission | PhotosPermission | ContactsPermission | GeolocationPermission | ClipboardPermission)",
|
|
819
|
-
value: input
|
|
820
|
-
});
|
|
821
|
-
})();
|
|
822
|
-
const _vu1 = (input, _path, _exceptionable = true) => (() => {
|
|
823
|
-
if ("string" === typeof input.name)
|
|
824
|
-
return _vo11(input, _path, _exceptionable);
|
|
825
|
-
else if ("object" === typeof input.source && null !== input.source && _vo10(input.source, _path + ".source", false))
|
|
826
|
-
return _vo9(input, _path, _exceptionable);
|
|
827
|
-
else
|
|
828
|
-
return _report(_exceptionable, {
|
|
829
|
-
path: _path,
|
|
830
|
-
expected: "(__type.o4 | __type.o2)",
|
|
831
|
-
value: input
|
|
832
|
-
});
|
|
833
|
-
})();
|
|
834
|
-
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
835
|
-
let errors;
|
|
836
|
-
let _report;
|
|
837
|
-
return __typia_transform__createStandardSchema._createStandardSchema((input) => {
|
|
838
|
-
if (false === __is(input)) {
|
|
839
|
-
errors = [];
|
|
840
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
841
|
-
((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
|
|
842
|
-
path: _path + "",
|
|
843
|
-
expected: "AppsInTossPluginOptions",
|
|
844
|
-
value: input2
|
|
845
|
-
})) && _vo0(input2, _path + "", true) || _report(true, {
|
|
846
|
-
path: _path + "",
|
|
847
|
-
expected: "AppsInTossPluginOptions",
|
|
848
|
-
value: input2
|
|
849
|
-
}))(input, "$input", true);
|
|
850
|
-
const success = 0 === errors.length;
|
|
851
|
-
return success ? {
|
|
852
|
-
success,
|
|
853
|
-
data: input
|
|
854
|
-
} : {
|
|
855
|
-
success,
|
|
856
|
-
errors,
|
|
857
|
-
data: input
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
return {
|
|
861
|
-
success: true,
|
|
862
|
-
data: input
|
|
863
|
-
};
|
|
864
|
-
});
|
|
865
|
-
})();
|
|
866
|
-
|
|
867
278
|
// src/utils/createArtifact.ts
|
|
868
|
-
async function validateZip(zipPath) {
|
|
869
|
-
const appJsonString = await (0, import_utils3.readZipContent)(zipPath, "app.json");
|
|
870
|
-
const appJson = JSON.parse(appJsonString);
|
|
871
|
-
const validated = validateAppManifest(appJson);
|
|
872
|
-
if (!validated.success) {
|
|
873
|
-
throw new Error("granite.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
279
|
async function createArtifact(options) {
|
|
877
|
-
const { bundleFiles, outfile, appJsonPath, reactNativeVersion } = options;
|
|
280
|
+
const { bundleFiles, outfile, appJsonPath, reactNativeVersion, sdkVersion, isGame } = options;
|
|
281
|
+
const unityMetaData = getUnityMetaDataEnv();
|
|
282
|
+
const appJsonContent = await fs3.readFile(appJsonPath, "utf-8");
|
|
283
|
+
const appJson = JSON.parse(appJsonContent);
|
|
284
|
+
const runtime = reactNativeVersion.replace(/\./g, "_");
|
|
878
285
|
const namedBundleFiles = bundleFiles.map((bundle) => {
|
|
879
|
-
const
|
|
880
|
-
const extension = import_path2.default.extname(originalName);
|
|
881
|
-
const runtime = reactNativeVersion.replace(new RegExp(/\./g), "_");
|
|
286
|
+
const extension = import_path2.default.extname(bundle.path);
|
|
882
287
|
return {
|
|
883
288
|
path: bundle.path,
|
|
884
|
-
|
|
885
|
-
name: `bundle.${bundle.platform}.${runtime}${extension === ".map" ? `.js.map` : extension}`
|
|
289
|
+
name: `bundle.${bundle.platform}.${runtime}${extension === ".map" ? ".js.map" : extension}`
|
|
886
290
|
};
|
|
887
291
|
});
|
|
888
|
-
|
|
889
|
-
runtimeVersion: reactNativeVersion,
|
|
890
|
-
bundleFiles: namedBundleFiles.map(({ name }) => name),
|
|
292
|
+
const writer = import_ait_format.AppsInTossBundle.writer({
|
|
891
293
|
deploymentId: options.deploymentId,
|
|
892
|
-
|
|
294
|
+
appName: appJson.appName,
|
|
295
|
+
createdBy: "@apps-in-toss/plugins"
|
|
893
296
|
});
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
297
|
+
writer.setMetadata({
|
|
298
|
+
platform: import_ait_format.PlatformType.REACT_NATIVE,
|
|
299
|
+
runtimeVersion: reactNativeVersion,
|
|
300
|
+
isGame,
|
|
301
|
+
sdkVersion,
|
|
302
|
+
bundleFiles: namedBundleFiles.map(({ name }) => name),
|
|
303
|
+
packageJson: options.packageJson,
|
|
304
|
+
extra: { unityMetaData }
|
|
897
305
|
});
|
|
898
|
-
|
|
306
|
+
for (const permission of appJson.permissions ?? []) {
|
|
307
|
+
writer.addPermission(permission.name, permission.access);
|
|
308
|
+
}
|
|
309
|
+
for (const bundle of namedBundleFiles) {
|
|
310
|
+
const content = await fs3.readFile(bundle.path);
|
|
311
|
+
writer.addFile(bundle.name, new Uint8Array(content));
|
|
312
|
+
}
|
|
313
|
+
for (const file of options.additionalFilesToZip ?? []) {
|
|
314
|
+
const content = await fs3.readFile(file.path);
|
|
315
|
+
writer.addFile(file.name, new Uint8Array(content));
|
|
316
|
+
}
|
|
317
|
+
const buffer = await writer.toBuffer();
|
|
318
|
+
await fs3.writeFile(outfile, buffer);
|
|
899
319
|
return outfile;
|
|
900
320
|
}
|
|
901
321
|
|
|
902
322
|
// src/plugins/artifact.ts
|
|
903
|
-
function appsInTossCreateArtifact(deploymentId) {
|
|
904
|
-
const packageRoot = (0,
|
|
323
|
+
function appsInTossCreateArtifact(deploymentId, buildOption) {
|
|
324
|
+
const packageRoot = (0, import_utils2.getPackageRoot)();
|
|
905
325
|
return {
|
|
906
326
|
name: "apps-in-toss:create-artifact",
|
|
907
327
|
build: {
|
|
@@ -916,6 +336,8 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
916
336
|
const artifactOutfile = await createArtifact({
|
|
917
337
|
reactNativeVersion: REACT_NATIVE_VERSION,
|
|
918
338
|
deploymentId,
|
|
339
|
+
sdkVersion: buildOption.sdkVersion,
|
|
340
|
+
isGame: buildOption.isGame,
|
|
919
341
|
packageJson: { dependencies, devDependencies },
|
|
920
342
|
bundleFiles: buildResults.filter(import_plugin_core.isBuildSuccess).map(({ outfile, sourcemapOutfile, platform }) => [
|
|
921
343
|
{
|
|
@@ -941,7 +363,6 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
941
363
|
}
|
|
942
364
|
|
|
943
365
|
// src/plugins/build.ts
|
|
944
|
-
init_cjs_shims();
|
|
945
366
|
function appsInTossEsbuildConfig(envScript) {
|
|
946
367
|
return {
|
|
947
368
|
name: "apps-in-toss:esbuild-config",
|
|
@@ -968,10 +389,9 @@ function appsInTossMetroConfig(envScriptPath) {
|
|
|
968
389
|
}
|
|
969
390
|
|
|
970
391
|
// src/plugins/compat.ts
|
|
971
|
-
init_cjs_shims();
|
|
972
392
|
var import_fs = __toESM(require("fs"), 1);
|
|
973
393
|
var import_path4 = __toESM(require("path"), 1);
|
|
974
|
-
var
|
|
394
|
+
var import_utils3 = require("@granite-js/utils");
|
|
975
395
|
var nativeModuleProxyContent = `
|
|
976
396
|
(function () {
|
|
977
397
|
global.nativeModuleProxy = new Proxy(global.nativeModuleProxy, {
|
|
@@ -1077,7 +497,7 @@ var reactNativeModuleProxyContent = `
|
|
|
1077
497
|
);
|
|
1078
498
|
`;
|
|
1079
499
|
function bedrockCompat({ isHost }) {
|
|
1080
|
-
const metroPolyfillContent = import_path4.default.join((0,
|
|
500
|
+
const metroPolyfillContent = import_path4.default.join((0, import_utils3.getLocalTempDirectoryPath)((0, import_utils3.getPackageRoot)()), "metro-native-module-proxy.js");
|
|
1081
501
|
import_fs.default.writeFileSync(metroPolyfillContent, nativeModuleProxyContent);
|
|
1082
502
|
return {
|
|
1083
503
|
name: "bedrock-compat-plugin",
|
|
@@ -1096,11 +516,7 @@ function bedrockCompat({ isHost }) {
|
|
|
1096
516
|
};
|
|
1097
517
|
}
|
|
1098
518
|
|
|
1099
|
-
// src/plugins/devServer.ts
|
|
1100
|
-
init_cjs_shims();
|
|
1101
|
-
|
|
1102
519
|
// src/utils/createServerPermissionsMiddleware.ts
|
|
1103
|
-
init_cjs_shims();
|
|
1104
520
|
function createServerPermissionsMiddleware(permissions) {
|
|
1105
521
|
const parsedPermissions = parsePermissions(permissions);
|
|
1106
522
|
return (req, res, next) => {
|
|
@@ -1117,12 +533,12 @@ function createServerPermissionsMiddleware(permissions) {
|
|
|
1117
533
|
function parsePermissions(permissions) {
|
|
1118
534
|
const permissionMap = /* @__PURE__ */ new Map();
|
|
1119
535
|
for (const permission of permissions) {
|
|
1120
|
-
const { name, access
|
|
536
|
+
const { name, access } = permission;
|
|
1121
537
|
if (!permissionMap.has(name)) {
|
|
1122
538
|
permissionMap.set(name, /* @__PURE__ */ new Set());
|
|
1123
539
|
}
|
|
1124
540
|
let accessValue = null;
|
|
1125
|
-
switch (
|
|
541
|
+
switch (access) {
|
|
1126
542
|
case "read":
|
|
1127
543
|
accessValue = "r";
|
|
1128
544
|
break;
|
|
@@ -1155,11 +571,7 @@ function appsInTossDevServer(options) {
|
|
|
1155
571
|
};
|
|
1156
572
|
}
|
|
1157
573
|
|
|
1158
|
-
// src/plugins/notice.ts
|
|
1159
|
-
init_cjs_shims();
|
|
1160
|
-
|
|
1161
574
|
// src/plugins/resolve.ts
|
|
1162
|
-
init_cjs_shims();
|
|
1163
575
|
var import_module = __toESM(require("module"), 1);
|
|
1164
576
|
function getRequire() {
|
|
1165
577
|
return typeof require === "function" ? require : import_module.default.createRequire(importMetaUrl);
|
|
@@ -1183,17 +595,21 @@ function requireMicroFrontendRuntime() {
|
|
|
1183
595
|
}
|
|
1184
596
|
|
|
1185
597
|
// src/utils/generateDeploymentId.ts
|
|
1186
|
-
init_cjs_shims();
|
|
1187
598
|
var import_uuidv7 = require("uuidv7");
|
|
1188
599
|
function generateDeploymentId() {
|
|
1189
600
|
return (0, import_uuidv7.uuidv7)();
|
|
1190
601
|
}
|
|
1191
602
|
|
|
603
|
+
// src/utils/getSdkVersion.ts
|
|
604
|
+
function getSdkVersion() {
|
|
605
|
+
const packageJson = require_package();
|
|
606
|
+
return packageJson.version;
|
|
607
|
+
}
|
|
608
|
+
|
|
1192
609
|
// src/utils/setupRuntimeSetupScript.ts
|
|
1193
|
-
init_cjs_shims();
|
|
1194
610
|
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
1195
611
|
var import_node_path = __toESM(require("path"), 1);
|
|
1196
|
-
var
|
|
612
|
+
var import_utils4 = require("@granite-js/utils");
|
|
1197
613
|
var import_esbuild = require("esbuild");
|
|
1198
614
|
function setupHostRuntimeSetupScript(metadata) {
|
|
1199
615
|
const script = getRuntimeSetupScript(metadata, HOST_CONTEXT_IDENTIFIER);
|
|
@@ -1223,7 +639,7 @@ function getRuntimeSetupScript(metadata, identifier) {
|
|
|
1223
639
|
}).code;
|
|
1224
640
|
}
|
|
1225
641
|
function writeRuntimeSetupScript(script) {
|
|
1226
|
-
const packageRoot = (0,
|
|
642
|
+
const packageRoot = (0, import_utils4.getPackageRoot)();
|
|
1227
643
|
const granitePath = import_node_path.default.join(packageRoot, ".granite");
|
|
1228
644
|
try {
|
|
1229
645
|
import_node_fs2.default.accessSync(granitePath);
|
|
@@ -1302,6 +718,11 @@ function appsInTossHost(options) {
|
|
|
1302
718
|
deploymentId,
|
|
1303
719
|
environment: getHostEnvironment()
|
|
1304
720
|
});
|
|
721
|
+
const sdkVersion = getSdkVersion();
|
|
722
|
+
const buildOptions = {
|
|
723
|
+
sdkVersion,
|
|
724
|
+
isGame: false
|
|
725
|
+
};
|
|
1305
726
|
return [
|
|
1306
727
|
requireMicroFrontendRuntime(),
|
|
1307
728
|
(0, import_plugin_micro_frontend.microFrontend)({
|
|
@@ -1317,7 +738,7 @@ function appsInTossHost(options) {
|
|
|
1317
738
|
}),
|
|
1318
739
|
appsInTossAppJson({ permissions: PERMISSIONS }),
|
|
1319
740
|
appsInTossDevServer({ permissions: PERMISSIONS }),
|
|
1320
|
-
appsInTossCreateArtifact(deploymentId),
|
|
741
|
+
appsInTossCreateArtifact(deploymentId, buildOptions),
|
|
1321
742
|
appsInTossEsbuildConfig(contents),
|
|
1322
743
|
appsInTossMetroConfig(envFilePath),
|
|
1323
744
|
bedrockCompat({ isHost: true }),
|