@appstrate/core 2.1.1 → 2.1.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/validation.ts +9 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appstrate/core",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
package/src/validation.ts CHANGED
@@ -36,10 +36,14 @@ export const serviceRequirementSchema = z.looseObject({
36
36
  connectionMode: z.enum(["user", "admin"]).optional(),
37
37
  });
38
38
 
39
- export const PACKAGE_REF_REGEX = new RegExp(`^(?:@${SLUG_PATTERN}\\/)?${SLUG_PATTERN}$`);
39
+ // ─────────────────────────────────────────────
40
+ // Base manifest schema — common fields for all package types
41
+ // ─────────────────────────────────────────────
42
+
43
+ export const scopedNameRegex = new RegExp(`^@${SLUG_PATTERN}\\/${SLUG_PATTERN}$`);
40
44
 
41
- const packageRefString = z.string().min(1).regex(PACKAGE_REF_REGEX, {
42
- error: "Must be a valid slug or scoped name (@scope/name)",
45
+ const packageRefString = z.string().min(1).regex(scopedNameRegex, {
46
+ error: "Must be a scoped name (@scope/name)",
43
47
  });
44
48
 
45
49
  const semverRangeString = z.string().refine((val) => semver.validRange(val) !== null, {
@@ -53,11 +57,6 @@ const registryDependenciesSchema = z
53
57
  })
54
58
  .optional();
55
59
 
56
- // ─────────────────────────────────────────────
57
- // Base manifest schema — common fields for all package types
58
- // ─────────────────────────────────────────────
59
-
60
- export const scopedNameRegex = new RegExp(`^@${SLUG_PATTERN}\\/${SLUG_PATTERN}$`);
61
60
  export const packageTypeEnum = z.enum(["flow", "skill", "extension"]);
62
61
  export type PackageType = z.infer<typeof packageTypeEnum>;
63
62
 
@@ -91,8 +90,8 @@ export type FlowJsonSchemaObject = z.infer<typeof jsonSchemaObjectSchema>;
91
90
  const flowSharedFields = {
92
91
  requires: z.looseObject({
93
92
  services: z.array(serviceRequirementSchema),
94
- skills: z.array(packageRefString).optional(),
95
- extensions: z.array(packageRefString).optional(),
93
+ skills: z.record(packageRefString, z.string()).optional(),
94
+ extensions: z.record(packageRefString, z.string()).optional(),
96
95
  }),
97
96
  input: z
98
97
  .object({