@playdrop/playdrop-cli 0.7.15 → 0.7.17
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/config/client-meta.json +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +461 -444
- package/node_modules/@playdrop/ai-client/package.json +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +903 -882
- package/node_modules/@playdrop/api-client/dist/core/errors.js +69 -45
- package/node_modules/@playdrop/api-client/dist/core/request.js +188 -159
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +516 -491
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +40 -14
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +480 -462
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +439 -419
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +696 -676
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +346 -320
- package/node_modules/@playdrop/api-client/dist/domains/comments.js +124 -98
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.js +91 -65
- package/node_modules/@playdrop/api-client/dist/domains/me.js +71 -45
- package/node_modules/@playdrop/api-client/dist/domains/payments.js +407 -386
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +144 -118
- package/node_modules/@playdrop/api-client/dist/domains/search.js +117 -104
- package/node_modules/@playdrop/api-client/dist/domains/tags.js +188 -162
- package/node_modules/@playdrop/api-client/dist/index.js +993 -552
- package/node_modules/@playdrop/api-client/package.json +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.js +84 -62
- package/node_modules/@playdrop/boxel-three/dist/src/builders.js +341 -308
- package/node_modules/@playdrop/boxel-three/dist/src/context.js +55 -29
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +856 -858
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +267 -261
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +64 -15
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +89 -63
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +81 -56
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +112 -86
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +45 -17
- package/node_modules/@playdrop/boxel-three/dist/src/scene.js +160 -136
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +582 -584
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +123 -97
- package/node_modules/@playdrop/boxel-three/dist/src/textures.js +207 -182
- package/node_modules/@playdrop/boxel-three/dist/src/types.js +15 -1
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +451 -425
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +109 -84
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +127 -106
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +73 -51
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +97 -79
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +29 -7
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +80 -60
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +41 -19
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +72 -50
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +84 -62
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +69 -47
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +129 -109
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +40 -18
- package/node_modules/@playdrop/boxel-three/package.json +1 -1
- package/node_modules/@playdrop/config/client-meta.json +1 -1
- package/node_modules/@playdrop/types/dist/api.js +289 -203
- package/node_modules/@playdrop/types/dist/app-capability-filters.js +112 -62
- package/node_modules/@playdrop/types/dist/app.js +91 -45
- package/node_modules/@playdrop/types/dist/asset-pack.js +37 -5
- package/node_modules/@playdrop/types/dist/asset-spec.js +170 -90
- package/node_modules/@playdrop/types/dist/asset.js +186 -108
- package/node_modules/@playdrop/types/dist/content-license.js +49 -15
- package/node_modules/@playdrop/types/dist/creator-public-image.js +60 -32
- package/node_modules/@playdrop/types/dist/ecs.js +102 -82
- package/node_modules/@playdrop/types/dist/engine-builtins.js +603 -573
- package/node_modules/@playdrop/types/dist/entity.js +63 -53
- package/node_modules/@playdrop/types/dist/graph.js +116 -80
- package/node_modules/@playdrop/types/dist/index.js +47 -20
- package/node_modules/@playdrop/types/dist/owned-assets.js +55 -33
- package/node_modules/@playdrop/types/dist/player-meta.js +151 -100
- package/node_modules/@playdrop/types/dist/realtime.js +27 -7
- package/node_modules/@playdrop/types/dist/version.js +182 -124
- package/node_modules/@playdrop/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,114 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var player_meta_exports = {};
|
|
19
|
+
__export(player_meta_exports, {
|
|
20
|
+
ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES: () => ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES,
|
|
21
|
+
ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES: () => ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES,
|
|
22
|
+
APP_ACHIEVEMENT_KIND_VALUES: () => APP_ACHIEVEMENT_KIND_VALUES,
|
|
23
|
+
APP_LEADERBOARD_SCORE_TYPE_VALUES: () => APP_LEADERBOARD_SCORE_TYPE_VALUES,
|
|
24
|
+
APP_LEADERBOARD_SORT_VALUES: () => APP_LEADERBOARD_SORT_VALUES,
|
|
25
|
+
PLAYER_META_DEFINITION_STATUS_VALUES: () => PLAYER_META_DEFINITION_STATUS_VALUES,
|
|
26
|
+
PLAYER_META_ERROR_CODE_VALUES: () => PLAYER_META_ERROR_CODE_VALUES,
|
|
27
|
+
PLAYER_META_KEY_REGEX: () => PLAYER_META_KEY_REGEX,
|
|
28
|
+
computeAchievementProgressPercent: () => computeAchievementProgressPercent,
|
|
29
|
+
formatLeaderboardScore: () => formatLeaderboardScore,
|
|
30
|
+
isPlayerMetaKey: () => isPlayerMetaKey,
|
|
31
|
+
isSafeNonNegativeInteger: () => isSafeNonNegativeInteger,
|
|
32
|
+
isSafePositiveInteger: () => isSafePositiveInteger,
|
|
33
|
+
isValidLeaderboardDefinitionCombination: () => isValidLeaderboardDefinitionCombination,
|
|
34
|
+
parseAdminAchievementMutationAction: () => parseAdminAchievementMutationAction,
|
|
35
|
+
parseAdminLeaderboardMutationAction: () => parseAdminLeaderboardMutationAction,
|
|
36
|
+
parseAppAchievementKind: () => parseAppAchievementKind,
|
|
37
|
+
parseAppLeaderboardScoreType: () => parseAppLeaderboardScoreType,
|
|
38
|
+
parseAppLeaderboardSort: () => parseAppLeaderboardSort,
|
|
39
|
+
parsePlayerMetaDefinitionStatus: () => parsePlayerMetaDefinitionStatus
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(player_meta_exports);
|
|
42
|
+
const PLAYER_META_KEY_REGEX = /^[a-z][a-z0-9_.-]{2,63}$/;
|
|
43
|
+
const PLAYER_META_DEFINITION_STATUS_VALUES = ["ACTIVE", "RETIRED"];
|
|
44
|
+
const APP_ACHIEVEMENT_KIND_VALUES = ["STANDARD", "INCREMENTAL"];
|
|
45
|
+
const APP_LEADERBOARD_SCORE_TYPE_VALUES = ["INTEGER", "TIME_MS"];
|
|
46
|
+
const APP_LEADERBOARD_SORT_VALUES = ["DESC", "ASC"];
|
|
47
|
+
const PLAYER_META_ERROR_CODE_VALUES = [
|
|
48
|
+
"E_AUTH_REQUIRED",
|
|
49
|
+
"E_RUNTIME_AUTH_REQUIRED",
|
|
50
|
+
"E_META_NOT_FOUND",
|
|
51
|
+
"E_META_RETIRED",
|
|
52
|
+
"E_META_INVALID_KEY",
|
|
53
|
+
"E_META_INVALID_DEFINITION",
|
|
54
|
+
"E_INVALID_ARGUMENT",
|
|
55
|
+
"E_SCORE_INVALID",
|
|
56
|
+
"E_PROGRESS_INVALID",
|
|
57
|
+
"E_FEATURE_KIND_MISMATCH",
|
|
58
|
+
"E_RATE_LIMITED"
|
|
18
59
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
60
|
+
const ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES = ["grant", "revoke", "reset"];
|
|
61
|
+
const ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES = ["reset", "remove"];
|
|
62
|
+
function isPlayerMetaKey(value) {
|
|
63
|
+
return typeof value === "string" && PLAYER_META_KEY_REGEX.test(value.trim());
|
|
23
64
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
? normalized
|
|
31
|
-
: null;
|
|
65
|
+
function parsePlayerMetaDefinitionStatus(value) {
|
|
66
|
+
if (typeof value !== "string") {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const normalized = value.trim().toUpperCase();
|
|
70
|
+
return PLAYER_META_DEFINITION_STATUS_VALUES.includes(normalized) ? normalized : null;
|
|
32
71
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
? normalized
|
|
40
|
-
: null;
|
|
72
|
+
function parseAppAchievementKind(value) {
|
|
73
|
+
if (typeof value !== "string") {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const normalized = value.trim().toUpperCase();
|
|
77
|
+
return APP_ACHIEVEMENT_KIND_VALUES.includes(normalized) ? normalized : null;
|
|
41
78
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
? normalized
|
|
49
|
-
: null;
|
|
79
|
+
function parseAppLeaderboardScoreType(value) {
|
|
80
|
+
if (typeof value !== "string") {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const normalized = value.trim().toUpperCase();
|
|
84
|
+
return APP_LEADERBOARD_SCORE_TYPE_VALUES.includes(normalized) ? normalized : null;
|
|
50
85
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
? normalized
|
|
58
|
-
: null;
|
|
86
|
+
function parseAppLeaderboardSort(value) {
|
|
87
|
+
if (typeof value !== "string") {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const normalized = value.trim().toUpperCase();
|
|
91
|
+
return APP_LEADERBOARD_SORT_VALUES.includes(normalized) ? normalized : null;
|
|
59
92
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
? normalized
|
|
67
|
-
: null;
|
|
93
|
+
function parseAdminAchievementMutationAction(value) {
|
|
94
|
+
if (typeof value !== "string") {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const normalized = value.trim().toLowerCase();
|
|
98
|
+
return ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES.includes(normalized) ? normalized : null;
|
|
68
99
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
? normalized
|
|
76
|
-
: null;
|
|
100
|
+
function parseAdminLeaderboardMutationAction(value) {
|
|
101
|
+
if (typeof value !== "string") {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const normalized = value.trim().toLowerCase();
|
|
105
|
+
return ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES.includes(normalized) ? normalized : null;
|
|
77
106
|
}
|
|
78
|
-
|
|
79
|
-
|
|
107
|
+
function isSafeNonNegativeInteger(value) {
|
|
108
|
+
return Number.isSafeInteger(value) && Number(value) >= 0;
|
|
80
109
|
}
|
|
81
|
-
|
|
82
|
-
|
|
110
|
+
function isSafePositiveInteger(value) {
|
|
111
|
+
return Number.isSafeInteger(value) && Number(value) > 0;
|
|
83
112
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|| (scoreType === 'TIME_MS' && sort === 'ASC'));
|
|
113
|
+
function isValidLeaderboardDefinitionCombination(scoreType, sort) {
|
|
114
|
+
return scoreType === "INTEGER" && sort === "DESC" || scoreType === "TIME_MS" && sort === "ASC";
|
|
87
115
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
function computeAchievementProgressPercent(progress, maxProgress) {
|
|
117
|
+
if (!Number.isSafeInteger(progress) || progress < 0) {
|
|
118
|
+
throw new Error("invalid_progress_value");
|
|
119
|
+
}
|
|
120
|
+
if (!Number.isSafeInteger(maxProgress) || maxProgress <= 0) {
|
|
121
|
+
throw new Error("invalid_max_progress_value");
|
|
122
|
+
}
|
|
123
|
+
const clamped = Math.min(progress, maxProgress);
|
|
124
|
+
return Math.floor(clamped / maxProgress * 100);
|
|
97
125
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
const totalMilliseconds = score;
|
|
107
|
-
const minutes = Math.floor(totalMilliseconds / 60_000);
|
|
108
|
-
const seconds = Math.floor((totalMilliseconds % 60_000) / 1_000);
|
|
109
|
-
const milliseconds = totalMilliseconds % 1_000;
|
|
110
|
-
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}.${String(milliseconds).padStart(3, '0')}`;
|
|
126
|
+
function formatLeaderboardScore(score, scoreType, unitLabel) {
|
|
127
|
+
if (!Number.isSafeInteger(score) || score < 0) {
|
|
128
|
+
throw new Error("invalid_score_value");
|
|
129
|
+
}
|
|
130
|
+
if (scoreType === "TIME_MS") {
|
|
131
|
+
if (score <= 0) {
|
|
132
|
+
throw new Error("invalid_time_score_value");
|
|
111
133
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
134
|
+
const totalMilliseconds = score;
|
|
135
|
+
const minutes = Math.floor(totalMilliseconds / 6e4);
|
|
136
|
+
const seconds = Math.floor(totalMilliseconds % 6e4 / 1e3);
|
|
137
|
+
const milliseconds = totalMilliseconds % 1e3;
|
|
138
|
+
return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds).padStart(3, "0")}`;
|
|
139
|
+
}
|
|
140
|
+
const formatted = new Intl.NumberFormat("en-US").format(score);
|
|
141
|
+
return unitLabel && unitLabel.trim().length > 0 ? `${formatted} ${unitLabel.trim()}` : formatted;
|
|
114
142
|
}
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES,
|
|
146
|
+
ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES,
|
|
147
|
+
APP_ACHIEVEMENT_KIND_VALUES,
|
|
148
|
+
APP_LEADERBOARD_SCORE_TYPE_VALUES,
|
|
149
|
+
APP_LEADERBOARD_SORT_VALUES,
|
|
150
|
+
PLAYER_META_DEFINITION_STATUS_VALUES,
|
|
151
|
+
PLAYER_META_ERROR_CODE_VALUES,
|
|
152
|
+
PLAYER_META_KEY_REGEX,
|
|
153
|
+
computeAchievementProgressPercent,
|
|
154
|
+
formatLeaderboardScore,
|
|
155
|
+
isPlayerMetaKey,
|
|
156
|
+
isSafeNonNegativeInteger,
|
|
157
|
+
isSafePositiveInteger,
|
|
158
|
+
isValidLeaderboardDefinitionCombination,
|
|
159
|
+
parseAdminAchievementMutationAction,
|
|
160
|
+
parseAdminLeaderboardMutationAction,
|
|
161
|
+
parseAppAchievementKind,
|
|
162
|
+
parseAppLeaderboardScoreType,
|
|
163
|
+
parseAppLeaderboardSort,
|
|
164
|
+
parsePlayerMetaDefinitionStatus
|
|
165
|
+
});
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var realtime_exports = {};
|
|
19
|
+
__export(realtime_exports, {
|
|
20
|
+
PLAYDROP_REALTIME_TYPES_VERSION: () => PLAYDROP_REALTIME_TYPES_VERSION
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(realtime_exports);
|
|
23
|
+
const PLAYDROP_REALTIME_TYPES_VERSION = 1;
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
PLAYDROP_REALTIME_TYPES_VERSION
|
|
27
|
+
});
|
|
@@ -1,139 +1,197 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var version_exports = {};
|
|
19
|
+
__export(version_exports, {
|
|
20
|
+
APP_AUTH_MODE_VALUES: () => APP_AUTH_MODE_VALUES,
|
|
21
|
+
APP_CONTROLLER_MODE_VALUES: () => APP_CONTROLLER_MODE_VALUES,
|
|
22
|
+
APP_HOSTING_MODE_VALUES: () => APP_HOSTING_MODE_VALUES,
|
|
23
|
+
APP_UPLOAD_INIT_STATUS_VALUES: () => APP_UPLOAD_INIT_STATUS_VALUES,
|
|
24
|
+
APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES: () => APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES,
|
|
25
|
+
APP_UPLOAD_SESSION_STATUS_VALUES: () => APP_UPLOAD_SESSION_STATUS_VALUES,
|
|
26
|
+
APP_VERSION_VISIBILITY_VALUES: () => APP_VERSION_VISIBILITY_VALUES,
|
|
27
|
+
DEFAULT_APP_AUTH_MODE: () => DEFAULT_APP_AUTH_MODE,
|
|
28
|
+
DEFAULT_APP_CONTROLLER_MODE: () => DEFAULT_APP_CONTROLLER_MODE,
|
|
29
|
+
DEFAULT_APP_HOSTING_MODE: () => DEFAULT_APP_HOSTING_MODE,
|
|
30
|
+
DEFAULT_APP_PREVIEWABLE: () => DEFAULT_APP_PREVIEWABLE,
|
|
31
|
+
DEFAULT_APP_VERSION_VISIBILITY: () => DEFAULT_APP_VERSION_VISIBILITY,
|
|
32
|
+
REVIEW_STATE_VALUES: () => REVIEW_STATE_VALUES,
|
|
33
|
+
SEMVER_REGEX: () => SEMVER_REGEX,
|
|
34
|
+
compareVersions: () => compareVersions,
|
|
35
|
+
formatVersion: () => formatVersion,
|
|
36
|
+
isAppAuthMode: () => isAppAuthMode,
|
|
37
|
+
isAppControllerMode: () => isAppControllerMode,
|
|
38
|
+
isAppHostingMode: () => isAppHostingMode,
|
|
39
|
+
isAppVersionVisibility: () => isAppVersionVisibility,
|
|
40
|
+
isReviewState: () => isReviewState,
|
|
41
|
+
isValidVersion: () => isValidVersion,
|
|
42
|
+
parseAppAuthMode: () => parseAppAuthMode,
|
|
43
|
+
parseAppControllerMode: () => parseAppControllerMode,
|
|
44
|
+
parseAppHostingMode: () => parseAppHostingMode,
|
|
45
|
+
parseAppVersionVisibility: () => parseAppVersionVisibility,
|
|
46
|
+
parseReviewState: () => parseReviewState,
|
|
47
|
+
parseVersion: () => parseVersion
|
|
48
|
+
});
|
|
49
|
+
module.exports = __toCommonJS(version_exports);
|
|
50
|
+
const APP_HOSTING_MODE_VALUES = ["HOSTED", "EXTERNAL"];
|
|
51
|
+
const DEFAULT_APP_HOSTING_MODE = "HOSTED";
|
|
52
|
+
function isAppHostingMode(value) {
|
|
53
|
+
if (typeof value !== "string") {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return APP_HOSTING_MODE_VALUES.includes(value.trim().toUpperCase());
|
|
11
57
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
58
|
+
function parseAppHostingMode(value) {
|
|
59
|
+
if (typeof value !== "string") {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const normalized = value.trim().toUpperCase();
|
|
63
|
+
return isAppHostingMode(normalized) ? normalized : null;
|
|
18
64
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
65
|
+
const APP_VERSION_VISIBILITY_VALUES = ["PRIVATE", "PUBLIC"];
|
|
66
|
+
const DEFAULT_APP_VERSION_VISIBILITY = "PUBLIC";
|
|
67
|
+
function isAppVersionVisibility(value) {
|
|
68
|
+
if (typeof value !== "string") {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return APP_VERSION_VISIBILITY_VALUES.includes(value.trim().toUpperCase());
|
|
26
72
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
73
|
+
function parseAppVersionVisibility(value) {
|
|
74
|
+
if (typeof value !== "string") {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const normalized = value.trim().toUpperCase();
|
|
78
|
+
return isAppVersionVisibility(normalized) ? normalized : null;
|
|
33
79
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
80
|
+
const REVIEW_STATE_VALUES = [
|
|
81
|
+
"NOT_REQUIRED",
|
|
82
|
+
"QUEUED",
|
|
83
|
+
"RUNNING",
|
|
84
|
+
"SUPERSEDED",
|
|
85
|
+
"LOW_QUALITY",
|
|
86
|
+
"PASSED",
|
|
87
|
+
"GOOD",
|
|
88
|
+
"EXCELLENT",
|
|
89
|
+
"FAILED",
|
|
90
|
+
"ERROR"
|
|
45
91
|
];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
92
|
+
function isReviewState(value) {
|
|
93
|
+
if (typeof value !== "string") {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
return REVIEW_STATE_VALUES.includes(value.trim().toUpperCase());
|
|
51
97
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
98
|
+
function parseReviewState(value) {
|
|
99
|
+
if (typeof value !== "string") {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const normalized = value.trim().toUpperCase();
|
|
103
|
+
return isReviewState(normalized) ? normalized : null;
|
|
58
104
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
105
|
+
const APP_AUTH_MODE_VALUES = ["REQUIRED", "OPTIONAL", "NONE"];
|
|
106
|
+
const DEFAULT_APP_AUTH_MODE = "REQUIRED";
|
|
107
|
+
function isAppAuthMode(value) {
|
|
108
|
+
if (typeof value !== "string") {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return APP_AUTH_MODE_VALUES.includes(value.trim().toUpperCase());
|
|
66
112
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
113
|
+
function parseAppAuthMode(value) {
|
|
114
|
+
if (typeof value !== "string") {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const normalized = value.trim().toUpperCase();
|
|
118
|
+
return isAppAuthMode(normalized) ? normalized : null;
|
|
73
119
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
120
|
+
const APP_CONTROLLER_MODE_VALUES = ["UNSUPPORTED", "SUPPORTED", "REQUIRED"];
|
|
121
|
+
const DEFAULT_APP_CONTROLLER_MODE = "UNSUPPORTED";
|
|
122
|
+
function isAppControllerMode(value) {
|
|
123
|
+
if (typeof value !== "string") {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return APP_CONTROLLER_MODE_VALUES.includes(value.trim().toUpperCase());
|
|
81
127
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
128
|
+
function parseAppControllerMode(value) {
|
|
129
|
+
if (typeof value !== "string") {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const normalized = value.trim().toUpperCase();
|
|
133
|
+
return isAppControllerMode(normalized) ? normalized : null;
|
|
88
134
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* Leading zeros are not allowed except for 0 itself.
|
|
94
|
-
*/
|
|
95
|
-
export const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
96
|
-
/**
|
|
97
|
-
* Format a SemVer object as a string (e.g., "1.2.3").
|
|
98
|
-
*/
|
|
99
|
-
export function formatVersion(v) {
|
|
100
|
-
return `${v.major}.${v.minor}.${v.patch}`;
|
|
135
|
+
const DEFAULT_APP_PREVIEWABLE = false;
|
|
136
|
+
const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
137
|
+
function formatVersion(v) {
|
|
138
|
+
return `${v.major}.${v.minor}.${v.patch}`;
|
|
101
139
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
major: parseInt(major, 10),
|
|
116
|
-
minor: parseInt(minor, 10),
|
|
117
|
-
patch: parseInt(patch, 10),
|
|
118
|
-
};
|
|
140
|
+
function parseVersion(s) {
|
|
141
|
+
const match = s.match(SEMVER_REGEX);
|
|
142
|
+
if (!match)
|
|
143
|
+
return null;
|
|
144
|
+
const [, major, minor, patch] = match;
|
|
145
|
+
if (!major || !minor || !patch) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
major: parseInt(major, 10),
|
|
150
|
+
minor: parseInt(minor, 10),
|
|
151
|
+
patch: parseInt(patch, 10)
|
|
152
|
+
};
|
|
119
153
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*/
|
|
123
|
-
export function isValidVersion(s) {
|
|
124
|
-
return SEMVER_REGEX.test(s);
|
|
154
|
+
function isValidVersion(s) {
|
|
155
|
+
return SEMVER_REGEX.test(s);
|
|
125
156
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return a.major - b.major;
|
|
133
|
-
if (a.minor !== b.minor)
|
|
134
|
-
return a.minor - b.minor;
|
|
135
|
-
return a.patch - b.patch;
|
|
157
|
+
function compareVersions(a, b) {
|
|
158
|
+
if (a.major !== b.major)
|
|
159
|
+
return a.major - b.major;
|
|
160
|
+
if (a.minor !== b.minor)
|
|
161
|
+
return a.minor - b.minor;
|
|
162
|
+
return a.patch - b.patch;
|
|
136
163
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
164
|
+
const APP_UPLOAD_SESSION_STATUS_VALUES = ["OPEN", "FINALIZED", "ABORTED", "EXPIRED"];
|
|
165
|
+
const APP_UPLOAD_INIT_STATUS_VALUES = ["created", "resume", "finalized"];
|
|
166
|
+
const APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES = ["NOT_RUN", "PASSED", "FAILED"];
|
|
167
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
168
|
+
0 && (module.exports = {
|
|
169
|
+
APP_AUTH_MODE_VALUES,
|
|
170
|
+
APP_CONTROLLER_MODE_VALUES,
|
|
171
|
+
APP_HOSTING_MODE_VALUES,
|
|
172
|
+
APP_UPLOAD_INIT_STATUS_VALUES,
|
|
173
|
+
APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES,
|
|
174
|
+
APP_UPLOAD_SESSION_STATUS_VALUES,
|
|
175
|
+
APP_VERSION_VISIBILITY_VALUES,
|
|
176
|
+
DEFAULT_APP_AUTH_MODE,
|
|
177
|
+
DEFAULT_APP_CONTROLLER_MODE,
|
|
178
|
+
DEFAULT_APP_HOSTING_MODE,
|
|
179
|
+
DEFAULT_APP_PREVIEWABLE,
|
|
180
|
+
DEFAULT_APP_VERSION_VISIBILITY,
|
|
181
|
+
REVIEW_STATE_VALUES,
|
|
182
|
+
SEMVER_REGEX,
|
|
183
|
+
compareVersions,
|
|
184
|
+
formatVersion,
|
|
185
|
+
isAppAuthMode,
|
|
186
|
+
isAppControllerMode,
|
|
187
|
+
isAppHostingMode,
|
|
188
|
+
isAppVersionVisibility,
|
|
189
|
+
isReviewState,
|
|
190
|
+
isValidVersion,
|
|
191
|
+
parseAppAuthMode,
|
|
192
|
+
parseAppControllerMode,
|
|
193
|
+
parseAppHostingMode,
|
|
194
|
+
parseAppVersionVisibility,
|
|
195
|
+
parseReviewState,
|
|
196
|
+
parseVersion
|
|
197
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playdrop/playdrop-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.17",
|
|
4
4
|
"description": "Official Playdrop CLI for publishing browser games, creator apps, and AI-generated game assets on playdrop.ai",
|
|
5
5
|
"homepage": "https://www.playdrop.ai",
|
|
6
6
|
"repository": {
|