@supernova-studio/model 0.55.29 → 0.55.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/elements/raw-element.ts +2 -2
- package/src/dsm/membership/design-system-membership.ts +1 -0
- package/src/dsm/membership/invitations.ts +2 -0
- package/src/utils/common.ts +1 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ObjectMeta } from "../../common";
|
|
2
3
|
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
4
|
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { ObjectMeta } from "../../common";
|
|
5
5
|
|
|
6
6
|
export type CreateDesignElement = DbCreateInputOmit<DesignElement>;
|
|
7
7
|
export type UpdateDesignElement = OmitStrict<
|
|
8
8
|
DbUpdate<DesignElement>,
|
|
9
|
-
"brandPersistentId" | "childType" | "designSystemVersionId" | "shortPersistentId"
|
|
9
|
+
"brandPersistentId" | "childType" | "designSystemVersionId" | "shortPersistentId"
|
|
10
10
|
>;
|
|
11
11
|
|
|
12
12
|
//
|
|
@@ -11,6 +11,7 @@ export const DesignSystemMembership = z.object({
|
|
|
11
11
|
designSystemId: z.string(),
|
|
12
12
|
designSystemRole: DesignSystemRole.optional(),
|
|
13
13
|
workspaceMembershipId: z.string(),
|
|
14
|
+
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
export type DesignSystemMembership = z.infer<typeof DesignSystemMembership>;
|
|
@@ -2,12 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
3
|
import { OmitStrict } from "../../utils";
|
|
4
4
|
import { DesignSystemRole } from "./ds-role";
|
|
5
|
+
import { WorkspaceRoleSchema } from "../../workspace";
|
|
5
6
|
|
|
6
7
|
export const DesignSystemInvitation = z.object({
|
|
7
8
|
id: z.string(),
|
|
8
9
|
designSystemId: z.string(),
|
|
9
10
|
workspaceInvitationId: z.string(),
|
|
10
11
|
designSystemRole: DesignSystemRole.optional(),
|
|
12
|
+
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
export type DesignSystemInvitation = z.infer<typeof DesignSystemInvitation>;
|
package/src/utils/common.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function parseUrl(url: string): URL {
|
|
|
58
58
|
return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export function mapByUnique<V, K>(items: V
|
|
61
|
+
export function mapByUnique<V, K>(items: Iterable<V>, keyFn: (item: V) => K): Map<K, V> {
|
|
62
62
|
const result = new Map<K, V>();
|
|
63
63
|
for (const item of items) {
|
|
64
64
|
result.set(keyFn(item), item);
|