revdev 0.115.0 → 0.117.0

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.
@@ -1,5 +1,5 @@
1
1
  import { CreateListRequest, UpdateListRequest } from "../../shared";
2
- export interface BoCreateListRequest extends CreateListRequest {
2
+ export interface BoCreateListRequest extends Omit<CreateListRequest, "isPrivate"> {
3
3
  }
4
- export interface BoUpdateListRequest extends UpdateListRequest {
4
+ export interface BoUpdateListRequest extends Omit<UpdateListRequest, "isPrivate"> {
5
5
  }
@@ -5,3 +5,4 @@ export * from "./literals";
5
5
  export * from "./request";
6
6
  export * from "./entity";
7
7
  export * from "./gen";
8
+ export * from "./link";
@@ -17,3 +17,4 @@ __exportStar(require("./literals"), exports);
17
17
  __exportStar(require("./request"), exports);
18
18
  __exportStar(require("./entity"), exports);
19
19
  __exportStar(require("./gen"), exports);
20
+ __exportStar(require("./link"), exports);
@@ -0,0 +1,14 @@
1
+ export interface LinkParentRequest {
2
+ link: boolean;
3
+ parentId: string;
4
+ childId: string | string[];
5
+ }
6
+ export interface LinkChildOption {
7
+ id: string;
8
+ link: boolean;
9
+ }
10
+ export interface LinkChildrenRequest {
11
+ parentId: string;
12
+ children: LinkChildOption[];
13
+ }
14
+ export declare type LinkRequest = LinkParentRequest | LinkChildrenRequest;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,20 +7,6 @@ export interface CodeRequest {
7
7
  export interface IdRequest {
8
8
  id: string;
9
9
  }
10
- export interface UserLinkRequest {
11
- id: string;
12
- link: boolean;
13
- }
14
- export interface EntityLinkRequest {
15
- parentId: string;
16
- childId: string | string[];
17
- link: boolean;
18
- }
19
- export interface LinkSetRequest {
20
- destinationId: string;
21
- sourceIds: string[];
22
- link: boolean;
23
- }
24
10
  export interface WordSetRequest {
25
11
  wordIds: string[];
26
12
  skip: number;
@@ -2,7 +2,7 @@ export interface CreateListRequest {
2
2
  name: string;
3
3
  description?: string;
4
4
  languageCode: string;
5
- isPrivate: boolean;
5
+ isPrivate?: boolean;
6
6
  slug?: string;
7
7
  baseListId?: string;
8
8
  isSuper?: boolean;
@@ -3,3 +3,4 @@ export * from "./converter";
3
3
  export * from "./string";
4
4
  export * from "./regex";
5
5
  export * from "./array";
6
+ export * from "./link";
@@ -15,3 +15,4 @@ __exportStar(require("./converter"), exports);
15
15
  __exportStar(require("./string"), exports);
16
16
  __exportStar(require("./regex"), exports);
17
17
  __exportStar(require("./array"), exports);
18
+ __exportStar(require("./link"), exports);
@@ -0,0 +1,4 @@
1
+ import { LinkChildrenRequest, LinkRequest } from "../common";
2
+ export declare class LinkUtil {
3
+ static parse(request: LinkRequest): LinkChildrenRequest;
4
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkUtil = void 0;
4
+ var LinkUtil = /** @class */ (function () {
5
+ function LinkUtil() {
6
+ }
7
+ LinkUtil.parse = function (request) {
8
+ var parentId = request.parentId;
9
+ var children = [];
10
+ if (request.childId) {
11
+ var _a = request, childId = _a.childId, link_1 = _a.link;
12
+ var childIds = Array.isArray(childId) ? childId : [childId];
13
+ children = childIds.map(function (x) {
14
+ return { id: x, link: link_1 };
15
+ });
16
+ }
17
+ else if (request.children) {
18
+ children = request.children;
19
+ }
20
+ return { parentId: parentId, children: children };
21
+ };
22
+ return LinkUtil;
23
+ }());
24
+ exports.LinkUtil = LinkUtil;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var link_1 = require("../link");
4
+ describe("LinkUtil", function () {
5
+ test("parse", function () {
6
+ expect(link_1.LinkUtil.parse({ parentId: "1", link: true, childId: "11" })).toMatchObject({
7
+ parentId: "1",
8
+ children: [{ link: true, id: "11" }],
9
+ });
10
+ expect(link_1.LinkUtil.parse({ parentId: "1", link: true, childId: ["11", "12"] })).toMatchObject({
11
+ parentId: "1",
12
+ children: [
13
+ { link: true, id: "11" },
14
+ { link: true, id: "12" },
15
+ ],
16
+ });
17
+ expect(link_1.LinkUtil.parse({ parentId: "1", link: false, childId: ["11", "12"] })).toMatchObject({
18
+ parentId: "1",
19
+ children: [
20
+ { link: false, id: "11" },
21
+ { link: false, id: "12" },
22
+ ],
23
+ });
24
+ });
25
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev",
3
- "version": "0.115.0",
3
+ "version": "0.117.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",