@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,72 +1,122 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
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 app_capability_filters_exports = {};
|
|
19
|
+
__export(app_capability_filters_exports, {
|
|
20
|
+
APP_AUTH_FILTER_VALUES: () => APP_AUTH_FILTER_VALUES,
|
|
21
|
+
APP_CONTROLLER_FILTER_VALUES: () => APP_CONTROLLER_FILTER_VALUES,
|
|
22
|
+
APP_SURFACE_FILTER_VALUES: () => APP_SURFACE_FILTER_VALUES,
|
|
23
|
+
hasAppCapabilityFilters: () => hasAppCapabilityFilters,
|
|
24
|
+
isAppAuthFilter: () => isAppAuthFilter,
|
|
25
|
+
isAppControllerFilter: () => isAppControllerFilter,
|
|
26
|
+
isAppSurfaceFilter: () => isAppSurfaceFilter,
|
|
27
|
+
mapAppAuthFilterToMode: () => mapAppAuthFilterToMode,
|
|
28
|
+
mapAppControllerFilterToMode: () => mapAppControllerFilterToMode,
|
|
29
|
+
mapAppSurfaceFilterToSurface: () => mapAppSurfaceFilterToSurface,
|
|
30
|
+
parseAppAuthFilter: () => parseAppAuthFilter,
|
|
31
|
+
parseAppControllerFilter: () => parseAppControllerFilter,
|
|
32
|
+
parseAppSurfaceFilter: () => parseAppSurfaceFilter
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(app_capability_filters_exports);
|
|
35
|
+
const APP_AUTH_FILTER_VALUES = ["required", "optional", "none"];
|
|
36
|
+
const APP_CONTROLLER_FILTER_VALUES = ["required", "optional", "none"];
|
|
37
|
+
const APP_SURFACE_FILTER_VALUES = ["desktop", "mobile-portrait", "mobile-landscape"];
|
|
38
|
+
function isAppAuthFilter(value) {
|
|
39
|
+
if (typeof value !== "string") {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return APP_AUTH_FILTER_VALUES.includes(value.trim().toLowerCase());
|
|
9
43
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
44
|
+
function parseAppAuthFilter(value) {
|
|
45
|
+
if (typeof value !== "string") {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const normalized = value.trim().toLowerCase();
|
|
49
|
+
return isAppAuthFilter(normalized) ? normalized : null;
|
|
16
50
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
function isAppControllerFilter(value) {
|
|
52
|
+
if (typeof value !== "string") {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return APP_CONTROLLER_FILTER_VALUES.includes(value.trim().toLowerCase());
|
|
22
56
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
57
|
+
function parseAppControllerFilter(value) {
|
|
58
|
+
if (typeof value !== "string") {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const normalized = value.trim().toLowerCase();
|
|
62
|
+
return isAppControllerFilter(normalized) ? normalized : null;
|
|
29
63
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
function isAppSurfaceFilter(value) {
|
|
65
|
+
if (typeof value !== "string") {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return APP_SURFACE_FILTER_VALUES.includes(value.trim().toLowerCase());
|
|
35
69
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
70
|
+
function parseAppSurfaceFilter(value) {
|
|
71
|
+
if (typeof value !== "string") {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const normalized = value.trim().toLowerCase();
|
|
75
|
+
return isAppSurfaceFilter(normalized) ? normalized : null;
|
|
42
76
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
77
|
+
function mapAppAuthFilterToMode(value) {
|
|
78
|
+
if (value === "required") {
|
|
79
|
+
return "REQUIRED";
|
|
80
|
+
}
|
|
81
|
+
if (value === "optional") {
|
|
82
|
+
return "OPTIONAL";
|
|
83
|
+
}
|
|
84
|
+
return "NONE";
|
|
51
85
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
86
|
+
function mapAppControllerFilterToMode(value) {
|
|
87
|
+
if (value === "required") {
|
|
88
|
+
return "REQUIRED";
|
|
89
|
+
}
|
|
90
|
+
if (value === "optional") {
|
|
91
|
+
return "SUPPORTED";
|
|
92
|
+
}
|
|
93
|
+
return "UNSUPPORTED";
|
|
60
94
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
95
|
+
function mapAppSurfaceFilterToSurface(value) {
|
|
96
|
+
if (value === "desktop") {
|
|
97
|
+
return "DESKTOP";
|
|
98
|
+
}
|
|
99
|
+
if (value === "mobile-portrait") {
|
|
100
|
+
return "MOBILE_PORTRAIT";
|
|
101
|
+
}
|
|
102
|
+
return "MOBILE_LANDSCAPE";
|
|
69
103
|
}
|
|
70
|
-
|
|
71
|
-
|
|
104
|
+
function hasAppCapabilityFilters(value) {
|
|
105
|
+
return Boolean(value?.auth || value?.controller || value?.surface);
|
|
72
106
|
}
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
APP_AUTH_FILTER_VALUES,
|
|
110
|
+
APP_CONTROLLER_FILTER_VALUES,
|
|
111
|
+
APP_SURFACE_FILTER_VALUES,
|
|
112
|
+
hasAppCapabilityFilters,
|
|
113
|
+
isAppAuthFilter,
|
|
114
|
+
isAppControllerFilter,
|
|
115
|
+
isAppSurfaceFilter,
|
|
116
|
+
mapAppAuthFilterToMode,
|
|
117
|
+
mapAppControllerFilterToMode,
|
|
118
|
+
mapAppSurfaceFilterToSurface,
|
|
119
|
+
parseAppAuthFilter,
|
|
120
|
+
parseAppControllerFilter,
|
|
121
|
+
parseAppSurfaceFilter
|
|
122
|
+
});
|
|
@@ -1,54 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 app_exports = {};
|
|
19
|
+
__export(app_exports, {
|
|
20
|
+
APP_SURFACE_VALUES: () => APP_SURFACE_VALUES,
|
|
21
|
+
APP_TYPE_DEFAULT_DISPLAY: () => APP_TYPE_DEFAULT_DISPLAY,
|
|
22
|
+
APP_TYPE_VALUES: () => APP_TYPE_VALUES,
|
|
23
|
+
DEFAULT_APP_SURFACE_TARGETS: () => DEFAULT_APP_SURFACE_TARGETS,
|
|
24
|
+
DEFAULT_APP_TYPE: () => DEFAULT_APP_TYPE,
|
|
25
|
+
getDefaultAppDisplayMetadata: () => getDefaultAppDisplayMetadata,
|
|
26
|
+
isAppSurface: () => isAppSurface,
|
|
27
|
+
isAppType: () => isAppType,
|
|
28
|
+
normalizeAppSurfaceList: () => normalizeAppSurfaceList,
|
|
29
|
+
normalizeAppType: () => normalizeAppType,
|
|
30
|
+
parseAppSurface: () => parseAppSurface,
|
|
31
|
+
parseAppType: () => parseAppType
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(app_exports);
|
|
34
|
+
const APP_TYPE_VALUES = ["GAME", "TEMPLATE", "TOOL", "DEMO"];
|
|
35
|
+
const DEFAULT_APP_TYPE = "GAME";
|
|
36
|
+
const APP_SURFACE_VALUES = ["DESKTOP", "MOBILE_LANDSCAPE", "MOBILE_PORTRAIT"];
|
|
37
|
+
const DEFAULT_APP_SURFACE_TARGETS = ["DESKTOP", "MOBILE_LANDSCAPE"];
|
|
38
|
+
function isAppType(value) {
|
|
39
|
+
if (typeof value !== "string") {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return APP_TYPE_VALUES.includes(value.trim().toUpperCase());
|
|
10
43
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
44
|
+
function parseAppType(value) {
|
|
45
|
+
if (typeof value !== "string") {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const normalized = value.trim().toUpperCase();
|
|
49
|
+
return isAppType(normalized) ? normalized : null;
|
|
17
50
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
function normalizeAppType(value, fallback = DEFAULT_APP_TYPE) {
|
|
52
|
+
const parsed = parseAppType(value);
|
|
53
|
+
return parsed ?? fallback;
|
|
21
54
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
55
|
+
function isAppSurface(value) {
|
|
56
|
+
if (typeof value !== "string") {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return APP_SURFACE_VALUES.includes(value.trim().toUpperCase());
|
|
27
60
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
61
|
+
function parseAppSurface(value) {
|
|
62
|
+
if (typeof value !== "string") {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const normalized = value.trim().toUpperCase();
|
|
66
|
+
return isAppSurface(normalized) ? normalized : null;
|
|
34
67
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (parsed.length > 0) {
|
|
41
|
-
return Array.from(new Set(parsed));
|
|
42
|
-
}
|
|
68
|
+
function normalizeAppSurfaceList(value, fallback = DEFAULT_APP_SURFACE_TARGETS) {
|
|
69
|
+
if (Array.isArray(value)) {
|
|
70
|
+
const parsed = value.map((entry) => parseAppSurface(entry)).filter((entry) => Boolean(entry));
|
|
71
|
+
if (parsed.length > 0) {
|
|
72
|
+
return Array.from(new Set(parsed));
|
|
43
73
|
}
|
|
44
|
-
|
|
74
|
+
}
|
|
75
|
+
return Array.from(fallback);
|
|
45
76
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
77
|
+
const APP_TYPE_DEFAULT_DISPLAY = {
|
|
78
|
+
GAME: { emoji: "\u{1F680}", color: "#FF383C" },
|
|
79
|
+
TOOL: { emoji: "\u{1F6E0}\uFE0F", color: "#0088FF" },
|
|
80
|
+
TEMPLATE: { emoji: "\u{1F4CB}", color: "#8E8E93" },
|
|
81
|
+
DEMO: { emoji: "\u{1F4A1}", color: "#000000" }
|
|
51
82
|
};
|
|
52
|
-
|
|
53
|
-
|
|
83
|
+
function getDefaultAppDisplayMetadata(type) {
|
|
84
|
+
return APP_TYPE_DEFAULT_DISPLAY[type] ?? APP_TYPE_DEFAULT_DISPLAY[DEFAULT_APP_TYPE];
|
|
54
85
|
}
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
88
|
+
APP_SURFACE_VALUES,
|
|
89
|
+
APP_TYPE_DEFAULT_DISPLAY,
|
|
90
|
+
APP_TYPE_VALUES,
|
|
91
|
+
DEFAULT_APP_SURFACE_TARGETS,
|
|
92
|
+
DEFAULT_APP_TYPE,
|
|
93
|
+
getDefaultAppDisplayMetadata,
|
|
94
|
+
isAppSurface,
|
|
95
|
+
isAppType,
|
|
96
|
+
normalizeAppSurfaceList,
|
|
97
|
+
normalizeAppType,
|
|
98
|
+
parseAppSurface,
|
|
99
|
+
parseAppType
|
|
100
|
+
});
|
|
@@ -1,6 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 asset_pack_exports = {};
|
|
19
|
+
__export(asset_pack_exports, {
|
|
20
|
+
ASSET_PACK_UPLOAD_INIT_STATUS_VALUES: () => ASSET_PACK_UPLOAD_INIT_STATUS_VALUES,
|
|
21
|
+
ASSET_PACK_UPLOAD_SESSION_STATUS_VALUES: () => ASSET_PACK_UPLOAD_SESSION_STATUS_VALUES,
|
|
22
|
+
VERSION_VISIBILITY_VALUES: () => VERSION_VISIBILITY_VALUES,
|
|
23
|
+
isVersionVisibility: () => isVersionVisibility
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(asset_pack_exports);
|
|
26
|
+
const VERSION_VISIBILITY_VALUES = ["PRIVATE", "PUBLIC"];
|
|
27
|
+
const ASSET_PACK_UPLOAD_SESSION_STATUS_VALUES = ["OPEN", "FINALIZED", "ABORTED", "EXPIRED"];
|
|
28
|
+
const ASSET_PACK_UPLOAD_INIT_STATUS_VALUES = ["created", "resume", "finalized"];
|
|
29
|
+
function isVersionVisibility(value) {
|
|
30
|
+
return typeof value === "string" && VERSION_VISIBILITY_VALUES.includes(value);
|
|
6
31
|
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
ASSET_PACK_UPLOAD_INIT_STATUS_VALUES,
|
|
35
|
+
ASSET_PACK_UPLOAD_SESSION_STATUS_VALUES,
|
|
36
|
+
VERSION_VISIBILITY_VALUES,
|
|
37
|
+
isVersionVisibility
|
|
38
|
+
});
|
|
@@ -1,101 +1,181 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var asset_spec_exports = {};
|
|
29
|
+
__export(asset_spec_exports, {
|
|
30
|
+
ASSET_SPEC_CAPABILITY_VALUES: () => ASSET_SPEC_CAPABILITY_VALUES,
|
|
31
|
+
ASSET_SPEC_CONTRACT_MAX_BYTES: () => ASSET_SPEC_CONTRACT_MAX_BYTES,
|
|
32
|
+
ASSET_SPEC_CONTRACT_META_SCHEMA: () => ASSET_SPEC_CONTRACT_META_SCHEMA,
|
|
33
|
+
ASSET_SPEC_LIST_SORT_VALUES: () => ASSET_SPEC_LIST_SORT_VALUES,
|
|
34
|
+
ASSET_SPEC_NAME_REGEX: () => ASSET_SPEC_NAME_REGEX,
|
|
35
|
+
ASSET_SPEC_REFERENCE_CARDINALITY_VALUES: () => ASSET_SPEC_REFERENCE_CARDINALITY_VALUES,
|
|
36
|
+
ASSET_SPEC_REFERENCE_TARGET_KIND_VALUES: () => ASSET_SPEC_REFERENCE_TARGET_KIND_VALUES,
|
|
37
|
+
ASSET_SPEC_ROLE_MODE_VALUES: () => ASSET_SPEC_ROLE_MODE_VALUES,
|
|
38
|
+
ASSET_SPEC_STATUS_VALUES: () => ASSET_SPEC_STATUS_VALUES,
|
|
39
|
+
ASSET_SPEC_VALIDATION_KIND_VALUES: () => ASSET_SPEC_VALIDATION_KIND_VALUES,
|
|
40
|
+
ASSET_SPEC_VISIBILITY_VALUES: () => ASSET_SPEC_VISIBILITY_VALUES,
|
|
41
|
+
ASSET_VALIDATION_STATUS_VALUES: () => ASSET_VALIDATION_STATUS_VALUES,
|
|
42
|
+
formatAssetSpecFamilyRef: () => formatAssetSpecFamilyRef,
|
|
43
|
+
formatAssetSpecVersionRef: () => formatAssetSpecVersionRef,
|
|
44
|
+
isAssetSpecCapability: () => isAssetSpecCapability,
|
|
45
|
+
isAssetSpecStatus: () => isAssetSpecStatus,
|
|
46
|
+
isAssetSpecValidationKind: () => isAssetSpecValidationKind,
|
|
47
|
+
isAssetSpecVisibility: () => isAssetSpecVisibility,
|
|
48
|
+
isAssetValidationStatus: () => isAssetValidationStatus,
|
|
49
|
+
isJsonLikeAssetSpecContentType: () => isJsonLikeAssetSpecContentType,
|
|
50
|
+
isValidAssetSpecName: () => isValidAssetSpecName,
|
|
51
|
+
parseAssetSpecFamilyRef: () => parseAssetSpecFamilyRef,
|
|
52
|
+
parseAssetSpecVersionRef: () => parseAssetSpecVersionRef
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(asset_spec_exports);
|
|
55
|
+
var import_version = require("./version.js");
|
|
56
|
+
var import_asset_spec_contract_meta_schema = __toESM(require("./asset-spec-contract-meta-schema.json"));
|
|
57
|
+
const ASSET_SPEC_NAME_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
58
|
+
const ASSET_SPEC_CONTRACT_MAX_BYTES = 256 * 1024;
|
|
59
|
+
const ASSET_SPEC_VISIBILITY_VALUES = ["PRIVATE", "PUBLIC"];
|
|
60
|
+
const ASSET_SPEC_VALIDATION_KIND_VALUES = ["NONE", "JSON_SCHEMA"];
|
|
61
|
+
const ASSET_VALIDATION_STATUS_VALUES = ["NOT_RUN", "PASSED", "FAILED"];
|
|
62
|
+
const ASSET_SPEC_STATUS_VALUES = ["ACTIVE", "DEPRECATED", "RETRACTED"];
|
|
63
|
+
const ASSET_SPEC_CAPABILITY_VALUES = ["READ", "WRITE", "EDIT", "PREVIEW", "IMPORT"];
|
|
64
|
+
const ASSET_SPEC_ROLE_MODE_VALUES = ["TEXT", "BINARY"];
|
|
65
|
+
const ASSET_SPEC_REFERENCE_TARGET_KIND_VALUES = ["ASSET"];
|
|
66
|
+
const ASSET_SPEC_REFERENCE_CARDINALITY_VALUES = ["ONE", "MANY"];
|
|
67
|
+
const ASSET_SPEC_LIST_SORT_VALUES = ["recent", "assets", "apps", "alpha"];
|
|
68
|
+
const ASSET_SPEC_CONTRACT_META_SCHEMA = import_asset_spec_contract_meta_schema.default;
|
|
69
|
+
function isAssetSpecVisibility(value) {
|
|
70
|
+
return typeof value === "string" && ASSET_SPEC_VISIBILITY_VALUES.includes(value);
|
|
17
71
|
}
|
|
18
|
-
|
|
19
|
-
|
|
72
|
+
function isAssetSpecValidationKind(value) {
|
|
73
|
+
return typeof value === "string" && ASSET_SPEC_VALIDATION_KIND_VALUES.includes(value);
|
|
20
74
|
}
|
|
21
|
-
|
|
22
|
-
|
|
75
|
+
function isAssetValidationStatus(value) {
|
|
76
|
+
return typeof value === "string" && ASSET_VALIDATION_STATUS_VALUES.includes(value);
|
|
23
77
|
}
|
|
24
|
-
|
|
25
|
-
|
|
78
|
+
function isAssetSpecStatus(value) {
|
|
79
|
+
return typeof value === "string" && ASSET_SPEC_STATUS_VALUES.includes(value);
|
|
26
80
|
}
|
|
27
|
-
|
|
28
|
-
|
|
81
|
+
function isAssetSpecCapability(value) {
|
|
82
|
+
return typeof value === "string" && ASSET_SPEC_CAPABILITY_VALUES.includes(value);
|
|
29
83
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
84
|
+
function isJsonLikeAssetSpecContentType(value) {
|
|
85
|
+
const normalized = value.trim().toLowerCase();
|
|
86
|
+
if (normalized === "application/json") {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return /^application\/[a-z0-9!#$&^_.+-]+\+json$/i.test(normalized);
|
|
36
90
|
}
|
|
37
|
-
|
|
38
|
-
|
|
91
|
+
function isValidAssetSpecName(value) {
|
|
92
|
+
return typeof value === "string" && ASSET_SPEC_NAME_REGEX.test(value.trim());
|
|
39
93
|
}
|
|
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
|
-
|
|
94
|
+
function parseAssetSpecFamilyRef(raw) {
|
|
95
|
+
if (typeof raw !== "string") {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const trimmed = raw.trim();
|
|
99
|
+
if (!trimmed.length) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const match = /^asset-spec:([^/]+)\/([^@]+)$/i.exec(trimmed);
|
|
103
|
+
if (!match) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const [, rawCreatorUsername, rawName] = match;
|
|
107
|
+
if (!rawCreatorUsername || !rawName) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const creatorUsername = rawCreatorUsername.trim();
|
|
111
|
+
const name = rawName.trim();
|
|
112
|
+
if (!creatorUsername.length || !name.length) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
kind: "asset-spec",
|
|
117
|
+
creatorUsername,
|
|
118
|
+
name
|
|
119
|
+
};
|
|
66
120
|
}
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
121
|
+
function parseAssetSpecVersionRef(raw) {
|
|
122
|
+
if (typeof raw !== "string") {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const trimmed = raw.trim();
|
|
126
|
+
if (!trimmed.length) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const match = /^asset-spec:([^/]+)\/([^@]+)@(.+)$/i.exec(trimmed);
|
|
130
|
+
if (!match) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const [, rawCreatorUsername, rawName, rawVersion] = match;
|
|
134
|
+
if (!rawCreatorUsername || !rawName || !rawVersion) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const creatorUsername = rawCreatorUsername.trim();
|
|
138
|
+
const name = rawName.trim();
|
|
139
|
+
const version = rawVersion.trim();
|
|
140
|
+
if (!creatorUsername.length || !name.length || !version.length || !import_version.SEMVER_REGEX.test(version)) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
kind: "asset-spec",
|
|
145
|
+
creatorUsername,
|
|
146
|
+
name,
|
|
147
|
+
version
|
|
148
|
+
};
|
|
95
149
|
}
|
|
96
|
-
|
|
97
|
-
|
|
150
|
+
function formatAssetSpecFamilyRef(ref) {
|
|
151
|
+
return `asset-spec:${ref.creatorUsername}/${ref.name}`;
|
|
98
152
|
}
|
|
99
|
-
|
|
100
|
-
|
|
153
|
+
function formatAssetSpecVersionRef(ref) {
|
|
154
|
+
return `asset-spec:${ref.creatorUsername}/${ref.name}@${ref.version}`;
|
|
101
155
|
}
|
|
156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
+
0 && (module.exports = {
|
|
158
|
+
ASSET_SPEC_CAPABILITY_VALUES,
|
|
159
|
+
ASSET_SPEC_CONTRACT_MAX_BYTES,
|
|
160
|
+
ASSET_SPEC_CONTRACT_META_SCHEMA,
|
|
161
|
+
ASSET_SPEC_LIST_SORT_VALUES,
|
|
162
|
+
ASSET_SPEC_NAME_REGEX,
|
|
163
|
+
ASSET_SPEC_REFERENCE_CARDINALITY_VALUES,
|
|
164
|
+
ASSET_SPEC_REFERENCE_TARGET_KIND_VALUES,
|
|
165
|
+
ASSET_SPEC_ROLE_MODE_VALUES,
|
|
166
|
+
ASSET_SPEC_STATUS_VALUES,
|
|
167
|
+
ASSET_SPEC_VALIDATION_KIND_VALUES,
|
|
168
|
+
ASSET_SPEC_VISIBILITY_VALUES,
|
|
169
|
+
ASSET_VALIDATION_STATUS_VALUES,
|
|
170
|
+
formatAssetSpecFamilyRef,
|
|
171
|
+
formatAssetSpecVersionRef,
|
|
172
|
+
isAssetSpecCapability,
|
|
173
|
+
isAssetSpecStatus,
|
|
174
|
+
isAssetSpecValidationKind,
|
|
175
|
+
isAssetSpecVisibility,
|
|
176
|
+
isAssetValidationStatus,
|
|
177
|
+
isJsonLikeAssetSpecContentType,
|
|
178
|
+
isValidAssetSpecName,
|
|
179
|
+
parseAssetSpecFamilyRef,
|
|
180
|
+
parseAssetSpecVersionRef
|
|
181
|
+
});
|