@playdrop/playdrop-cli 0.7.15 → 0.7.16

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.
Files changed (70) hide show
  1. package/config/client-meta.json +1 -1
  2. package/node_modules/@playdrop/ai-client/dist/index.js +461 -444
  3. package/node_modules/@playdrop/ai-client/package.json +1 -1
  4. package/node_modules/@playdrop/api-client/dist/client.js +903 -882
  5. package/node_modules/@playdrop/api-client/dist/core/errors.js +69 -45
  6. package/node_modules/@playdrop/api-client/dist/core/request.js +188 -159
  7. package/node_modules/@playdrop/api-client/dist/domains/admin.js +516 -491
  8. package/node_modules/@playdrop/api-client/dist/domains/ai.js +40 -14
  9. package/node_modules/@playdrop/api-client/dist/domains/apps.js +480 -462
  10. package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +439 -419
  11. package/node_modules/@playdrop/api-client/dist/domains/assets.js +696 -676
  12. package/node_modules/@playdrop/api-client/dist/domains/auth.js +346 -320
  13. package/node_modules/@playdrop/api-client/dist/domains/comments.js +124 -98
  14. package/node_modules/@playdrop/api-client/dist/domains/free-credits.js +91 -65
  15. package/node_modules/@playdrop/api-client/dist/domains/me.js +71 -45
  16. package/node_modules/@playdrop/api-client/dist/domains/payments.js +407 -386
  17. package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +144 -118
  18. package/node_modules/@playdrop/api-client/dist/domains/search.js +117 -104
  19. package/node_modules/@playdrop/api-client/dist/domains/tags.js +188 -162
  20. package/node_modules/@playdrop/api-client/dist/index.js +993 -552
  21. package/node_modules/@playdrop/api-client/package.json +1 -1
  22. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +84 -62
  23. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +341 -308
  24. package/node_modules/@playdrop/boxel-three/dist/src/context.js +55 -29
  25. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +856 -858
  26. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +267 -261
  27. package/node_modules/@playdrop/boxel-three/dist/src/index.js +64 -15
  28. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +89 -63
  29. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +81 -56
  30. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +112 -86
  31. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +45 -17
  32. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +160 -136
  33. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +582 -584
  34. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +123 -97
  35. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +207 -182
  36. package/node_modules/@playdrop/boxel-three/dist/src/types.js +15 -1
  37. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +451 -425
  38. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +109 -84
  39. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +127 -106
  40. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +73 -51
  41. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +97 -79
  42. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +29 -7
  43. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +80 -60
  44. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +41 -19
  45. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +72 -50
  46. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +84 -62
  47. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +69 -47
  48. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +129 -109
  49. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +40 -18
  50. package/node_modules/@playdrop/boxel-three/package.json +1 -1
  51. package/node_modules/@playdrop/config/client-meta.json +1 -1
  52. package/node_modules/@playdrop/types/dist/api.js +289 -203
  53. package/node_modules/@playdrop/types/dist/app-capability-filters.js +112 -62
  54. package/node_modules/@playdrop/types/dist/app.js +91 -45
  55. package/node_modules/@playdrop/types/dist/asset-pack.js +37 -5
  56. package/node_modules/@playdrop/types/dist/asset-spec.js +170 -90
  57. package/node_modules/@playdrop/types/dist/asset.js +186 -108
  58. package/node_modules/@playdrop/types/dist/content-license.js +49 -15
  59. package/node_modules/@playdrop/types/dist/creator-public-image.js +60 -32
  60. package/node_modules/@playdrop/types/dist/ecs.js +102 -82
  61. package/node_modules/@playdrop/types/dist/engine-builtins.js +603 -573
  62. package/node_modules/@playdrop/types/dist/entity.js +63 -53
  63. package/node_modules/@playdrop/types/dist/graph.js +116 -80
  64. package/node_modules/@playdrop/types/dist/index.js +47 -20
  65. package/node_modules/@playdrop/types/dist/owned-assets.js +55 -33
  66. package/node_modules/@playdrop/types/dist/player-meta.js +151 -100
  67. package/node_modules/@playdrop/types/dist/realtime.js +27 -7
  68. package/node_modules/@playdrop/types/dist/version.js +182 -124
  69. package/node_modules/@playdrop/types/package.json +1 -1
  70. package/package.json +1 -1
@@ -1,72 +1,122 @@
1
- export const APP_AUTH_FILTER_VALUES = ['required', 'optional', 'none'];
2
- export const APP_CONTROLLER_FILTER_VALUES = ['required', 'optional', 'none'];
3
- export const APP_SURFACE_FILTER_VALUES = ['desktop', 'mobile-portrait', 'mobile-landscape'];
4
- export function isAppAuthFilter(value) {
5
- if (typeof value !== 'string') {
6
- return false;
7
- }
8
- return APP_AUTH_FILTER_VALUES.includes(value.trim().toLowerCase());
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
- export function parseAppAuthFilter(value) {
11
- if (typeof value !== 'string') {
12
- return null;
13
- }
14
- const normalized = value.trim().toLowerCase();
15
- return isAppAuthFilter(normalized) ? normalized : null;
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
- export function isAppControllerFilter(value) {
18
- if (typeof value !== 'string') {
19
- return false;
20
- }
21
- return APP_CONTROLLER_FILTER_VALUES.includes(value.trim().toLowerCase());
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
- export function parseAppControllerFilter(value) {
24
- if (typeof value !== 'string') {
25
- return null;
26
- }
27
- const normalized = value.trim().toLowerCase();
28
- return isAppControllerFilter(normalized) ? normalized : null;
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
- export function isAppSurfaceFilter(value) {
31
- if (typeof value !== 'string') {
32
- return false;
33
- }
34
- return APP_SURFACE_FILTER_VALUES.includes(value.trim().toLowerCase());
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
- export function parseAppSurfaceFilter(value) {
37
- if (typeof value !== 'string') {
38
- return null;
39
- }
40
- const normalized = value.trim().toLowerCase();
41
- return isAppSurfaceFilter(normalized) ? normalized : null;
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
- export function mapAppAuthFilterToMode(value) {
44
- if (value === 'required') {
45
- return 'REQUIRED';
46
- }
47
- if (value === 'optional') {
48
- return 'OPTIONAL';
49
- }
50
- return 'NONE';
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
- export function mapAppControllerFilterToMode(value) {
53
- if (value === 'required') {
54
- return 'REQUIRED';
55
- }
56
- if (value === 'optional') {
57
- return 'SUPPORTED';
58
- }
59
- return 'UNSUPPORTED';
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
- export function mapAppSurfaceFilterToSurface(value) {
62
- if (value === 'desktop') {
63
- return 'DESKTOP';
64
- }
65
- if (value === 'mobile-portrait') {
66
- return 'MOBILE_PORTRAIT';
67
- }
68
- return 'MOBILE_LANDSCAPE';
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
- export function hasAppCapabilityFilters(value) {
71
- return Boolean(value?.auth || value?.controller || value?.surface);
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
- export const APP_TYPE_VALUES = ['GAME', 'TEMPLATE', 'TOOL', 'DEMO'];
2
- export const DEFAULT_APP_TYPE = 'GAME';
3
- export const APP_SURFACE_VALUES = ['DESKTOP', 'MOBILE_LANDSCAPE', 'MOBILE_PORTRAIT'];
4
- export const DEFAULT_APP_SURFACE_TARGETS = ['DESKTOP', 'MOBILE_LANDSCAPE'];
5
- export function isAppType(value) {
6
- if (typeof value !== 'string') {
7
- return false;
8
- }
9
- return APP_TYPE_VALUES.includes(value.trim().toUpperCase());
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
- export function parseAppType(value) {
12
- if (typeof value !== 'string') {
13
- return null;
14
- }
15
- const normalized = value.trim().toUpperCase();
16
- return isAppType(normalized) ? normalized : null;
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
- export function normalizeAppType(value, fallback = DEFAULT_APP_TYPE) {
19
- const parsed = parseAppType(value);
20
- return parsed ?? fallback;
51
+ function normalizeAppType(value, fallback = DEFAULT_APP_TYPE) {
52
+ const parsed = parseAppType(value);
53
+ return parsed ?? fallback;
21
54
  }
22
- export function isAppSurface(value) {
23
- if (typeof value !== 'string') {
24
- return false;
25
- }
26
- return APP_SURFACE_VALUES.includes(value.trim().toUpperCase());
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
- export function parseAppSurface(value) {
29
- if (typeof value !== 'string') {
30
- return null;
31
- }
32
- const normalized = value.trim().toUpperCase();
33
- return isAppSurface(normalized) ? normalized : null;
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
- export function normalizeAppSurfaceList(value, fallback = DEFAULT_APP_SURFACE_TARGETS) {
36
- if (Array.isArray(value)) {
37
- const parsed = value
38
- .map((entry) => parseAppSurface(entry))
39
- .filter((entry) => Boolean(entry));
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
- return Array.from(fallback);
74
+ }
75
+ return Array.from(fallback);
45
76
  }
46
- export const APP_TYPE_DEFAULT_DISPLAY = {
47
- GAME: { emoji: '🚀', color: '#FF383C' },
48
- TOOL: { emoji: '🛠️', color: '#0088FF' },
49
- TEMPLATE: { emoji: '📋', color: '#8E8E93' },
50
- DEMO: { emoji: '💡', color: '#000000' },
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
- export function getDefaultAppDisplayMetadata(type) {
53
- return APP_TYPE_DEFAULT_DISPLAY[type] ?? APP_TYPE_DEFAULT_DISPLAY[DEFAULT_APP_TYPE];
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
- export const VERSION_VISIBILITY_VALUES = ['PRIVATE', 'PUBLIC'];
2
- export const ASSET_PACK_UPLOAD_SESSION_STATUS_VALUES = ['OPEN', 'FINALIZED', 'ABORTED', 'EXPIRED'];
3
- export const ASSET_PACK_UPLOAD_INIT_STATUS_VALUES = ['created', 'resume', 'finalized'];
4
- export function isVersionVisibility(value) {
5
- return typeof value === 'string' && VERSION_VISIBILITY_VALUES.includes(value);
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
- import { SEMVER_REGEX } from './version.js';
2
- import ASSET_SPEC_CONTRACT_META_SCHEMA_JSON from './asset-spec-contract-meta-schema.json' with { type: 'json' };
3
- export const ASSET_SPEC_NAME_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
4
- export const ASSET_SPEC_CONTRACT_MAX_BYTES = 256 * 1024;
5
- export const ASSET_SPEC_VISIBILITY_VALUES = ['PRIVATE', 'PUBLIC'];
6
- export const ASSET_SPEC_VALIDATION_KIND_VALUES = ['NONE', 'JSON_SCHEMA'];
7
- export const ASSET_VALIDATION_STATUS_VALUES = ['NOT_RUN', 'PASSED', 'FAILED'];
8
- export const ASSET_SPEC_STATUS_VALUES = ['ACTIVE', 'DEPRECATED', 'RETRACTED'];
9
- export const ASSET_SPEC_CAPABILITY_VALUES = ['READ', 'WRITE', 'EDIT', 'PREVIEW', 'IMPORT'];
10
- export const ASSET_SPEC_ROLE_MODE_VALUES = ['TEXT', 'BINARY'];
11
- export const ASSET_SPEC_REFERENCE_TARGET_KIND_VALUES = ['ASSET'];
12
- export const ASSET_SPEC_REFERENCE_CARDINALITY_VALUES = ['ONE', 'MANY'];
13
- export const ASSET_SPEC_LIST_SORT_VALUES = ['recent', 'assets', 'apps', 'alpha'];
14
- export const ASSET_SPEC_CONTRACT_META_SCHEMA = ASSET_SPEC_CONTRACT_META_SCHEMA_JSON;
15
- export function isAssetSpecVisibility(value) {
16
- return typeof value === 'string' && ASSET_SPEC_VISIBILITY_VALUES.includes(value);
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
- export function isAssetSpecValidationKind(value) {
19
- return typeof value === 'string' && ASSET_SPEC_VALIDATION_KIND_VALUES.includes(value);
72
+ function isAssetSpecValidationKind(value) {
73
+ return typeof value === "string" && ASSET_SPEC_VALIDATION_KIND_VALUES.includes(value);
20
74
  }
21
- export function isAssetValidationStatus(value) {
22
- return typeof value === 'string' && ASSET_VALIDATION_STATUS_VALUES.includes(value);
75
+ function isAssetValidationStatus(value) {
76
+ return typeof value === "string" && ASSET_VALIDATION_STATUS_VALUES.includes(value);
23
77
  }
24
- export function isAssetSpecStatus(value) {
25
- return typeof value === 'string' && ASSET_SPEC_STATUS_VALUES.includes(value);
78
+ function isAssetSpecStatus(value) {
79
+ return typeof value === "string" && ASSET_SPEC_STATUS_VALUES.includes(value);
26
80
  }
27
- export function isAssetSpecCapability(value) {
28
- return typeof value === 'string' && ASSET_SPEC_CAPABILITY_VALUES.includes(value);
81
+ function isAssetSpecCapability(value) {
82
+ return typeof value === "string" && ASSET_SPEC_CAPABILITY_VALUES.includes(value);
29
83
  }
30
- export function isJsonLikeAssetSpecContentType(value) {
31
- const normalized = value.trim().toLowerCase();
32
- if (normalized === 'application/json') {
33
- return true;
34
- }
35
- return /^application\/[a-z0-9!#$&^_.+-]+\+json$/i.test(normalized);
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
- export function isValidAssetSpecName(value) {
38
- return typeof value === 'string' && ASSET_SPEC_NAME_REGEX.test(value.trim());
91
+ function isValidAssetSpecName(value) {
92
+ return typeof value === "string" && ASSET_SPEC_NAME_REGEX.test(value.trim());
39
93
  }
40
- export function parseAssetSpecFamilyRef(raw) {
41
- if (typeof raw !== 'string') {
42
- return null;
43
- }
44
- const trimmed = raw.trim();
45
- if (!trimmed.length) {
46
- return null;
47
- }
48
- const match = /^asset-spec:([^/]+)\/([^@]+)$/i.exec(trimmed);
49
- if (!match) {
50
- return null;
51
- }
52
- const [, rawCreatorUsername, rawName] = match;
53
- if (!rawCreatorUsername || !rawName) {
54
- return null;
55
- }
56
- const creatorUsername = rawCreatorUsername.trim();
57
- const name = rawName.trim();
58
- if (!creatorUsername.length || !name.length) {
59
- return null;
60
- }
61
- return {
62
- kind: 'asset-spec',
63
- creatorUsername,
64
- name,
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
- export function parseAssetSpecVersionRef(raw) {
68
- if (typeof raw !== 'string') {
69
- return null;
70
- }
71
- const trimmed = raw.trim();
72
- if (!trimmed.length) {
73
- return null;
74
- }
75
- const match = /^asset-spec:([^/]+)\/([^@]+)@(.+)$/i.exec(trimmed);
76
- if (!match) {
77
- return null;
78
- }
79
- const [, rawCreatorUsername, rawName, rawVersion] = match;
80
- if (!rawCreatorUsername || !rawName || !rawVersion) {
81
- return null;
82
- }
83
- const creatorUsername = rawCreatorUsername.trim();
84
- const name = rawName.trim();
85
- const version = rawVersion.trim();
86
- if (!creatorUsername.length || !name.length || !version.length || !SEMVER_REGEX.test(version)) {
87
- return null;
88
- }
89
- return {
90
- kind: 'asset-spec',
91
- creatorUsername,
92
- name,
93
- version,
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
- export function formatAssetSpecFamilyRef(ref) {
97
- return `asset-spec:${ref.creatorUsername}/${ref.name}`;
150
+ function formatAssetSpecFamilyRef(ref) {
151
+ return `asset-spec:${ref.creatorUsername}/${ref.name}`;
98
152
  }
99
- export function formatAssetSpecVersionRef(ref) {
100
- return `asset-spec:${ref.creatorUsername}/${ref.name}@${ref.version}`;
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
+ });