@lokalise/chatter-api-contracts 0.1.3 → 0.1.4
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/api/contracts/comments/delete-comment-reply.d.ts +7 -3
- package/dist/api/contracts/comments/delete-comment-reply.js +7 -3
- package/dist/api/contracts/comments/delete-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/delete-comment.d.ts +7 -3
- package/dist/api/contracts/comments/delete-comment.js +7 -3
- package/dist/api/contracts/comments/delete-comment.js.map +1 -1
- package/dist/api/errors/comment-delete-permission-required.d.ts +10 -0
- package/dist/api/errors/comment-delete-permission-required.js +7 -0
- package/dist/api/errors/comment-delete-permission-required.js.map +1 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/errors/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare const deleteCommentReplyContract: Omit<{
|
|
|
9
9
|
readonly method: "delete";
|
|
10
10
|
readonly visibility: "internal";
|
|
11
11
|
readonly summary: "Delete a reply";
|
|
12
|
-
readonly description:
|
|
12
|
+
readonly description: string;
|
|
13
13
|
readonly tags: readonly ["Comments"];
|
|
14
14
|
readonly requestHeaderSchema: z.ZodObject<{
|
|
15
15
|
authorization: z.ZodString;
|
|
@@ -38,11 +38,15 @@ export declare const deleteCommentReplyContract: Omit<{
|
|
|
38
38
|
errorCode: z.ZodString;
|
|
39
39
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
40
40
|
}, z.core.$strip>;
|
|
41
|
-
403: z.ZodObject<{
|
|
41
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
42
42
|
message: z.ZodString;
|
|
43
43
|
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
44
44
|
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
45
|
-
}, z.core.$strip
|
|
45
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
+
message: z.ZodString;
|
|
47
|
+
code: z.ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
48
|
+
errorCode: z.ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
49
|
+
}, z.core.$strip>]>;
|
|
46
50
|
404: z.ZodObject<{
|
|
47
51
|
message: z.ZodString;
|
|
48
52
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { commentDeletePermissionRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
5
5
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
6
6
|
// ------------------------------------------------------------
|
|
@@ -15,7 +15,8 @@ export const deleteCommentReplyContract = defineApiContract({
|
|
|
15
15
|
method: 'delete',
|
|
16
16
|
visibility: 'internal',
|
|
17
17
|
summary: 'Delete a reply',
|
|
18
|
-
description: 'Deletes a reply from the thread of a comment. The rest of the thread is kept.'
|
|
18
|
+
description: 'Deletes a reply from the thread of a comment. The rest of the thread is kept. ' +
|
|
19
|
+
'The author and team owners, admins and billers can delete it.',
|
|
19
20
|
tags: [OpenApiTags.Comments.name],
|
|
20
21
|
requestHeaderSchema: AUTH_HEADERS,
|
|
21
22
|
requestPathParamsSchema: DELETE_COMMENT_REPLY_PATH_PARAMS_SCHEMA,
|
|
@@ -24,7 +25,10 @@ export const deleteCommentReplyContract = defineApiContract({
|
|
|
24
25
|
204: noBodyResponse({ description: 'Reply deleted' }),
|
|
25
26
|
400: ERROR_RESPONSE_SCHEMA,
|
|
26
27
|
401: ERROR_RESPONSE_SCHEMA,
|
|
27
|
-
403:
|
|
28
|
+
403: z.union([
|
|
29
|
+
teamAccessDeniedErrorDefinition.schema,
|
|
30
|
+
commentDeletePermissionRequiredErrorDefinition.schema,
|
|
31
|
+
]),
|
|
28
32
|
404: resourceNotFoundErrorDefinition.schema,
|
|
29
33
|
500: ERROR_RESPONSE_SCHEMA,
|
|
30
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-comment-reply.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/delete-comment-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,gEAAgE;AAChE,+DAA+D;AAC/D,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;CAC9C,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,gBAAgB;IACzB,WAAW,
|
|
1
|
+
{"version":3,"file":"delete-comment-reply.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/delete-comment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AG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;YACX,+BAA+B,CAAC,MAAM;YACtC,8CAA8C,CAAC,MAAM;SACtD,CAAC;QACF,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -8,7 +8,7 @@ export declare const deleteCommentContract: Omit<{
|
|
|
8
8
|
readonly method: "delete";
|
|
9
9
|
readonly visibility: "internal";
|
|
10
10
|
readonly summary: "Delete a comment";
|
|
11
|
-
readonly description:
|
|
11
|
+
readonly description: string;
|
|
12
12
|
readonly tags: readonly ["Comments"];
|
|
13
13
|
readonly requestHeaderSchema: z.ZodObject<{
|
|
14
14
|
authorization: z.ZodString;
|
|
@@ -35,11 +35,15 @@ export declare const deleteCommentContract: Omit<{
|
|
|
35
35
|
errorCode: z.ZodString;
|
|
36
36
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
|
-
403: z.ZodObject<{
|
|
38
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
39
39
|
message: z.ZodString;
|
|
40
40
|
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
41
41
|
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
42
|
-
}, z.core.$strip
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
message: z.ZodString;
|
|
44
|
+
code: z.ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
45
|
+
errorCode: z.ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
46
|
+
}, z.core.$strip>]>;
|
|
43
47
|
404: z.ZodObject<{
|
|
44
48
|
message: z.ZodString;
|
|
45
49
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { commentDeletePermissionRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
5
5
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
6
6
|
// ------------------------------------------------------------
|
|
@@ -14,7 +14,8 @@ export const deleteCommentContract = defineApiContract({
|
|
|
14
14
|
method: 'delete',
|
|
15
15
|
visibility: 'internal',
|
|
16
16
|
summary: 'Delete a comment',
|
|
17
|
-
description: 'Deletes a comment and its whole thread, replies included.'
|
|
17
|
+
description: 'Deletes a comment and its whole thread, replies included. ' +
|
|
18
|
+
'The author and team owners, admins and billers can delete it. Subscriptions to the thread are kept.',
|
|
18
19
|
tags: [OpenApiTags.Comments.name],
|
|
19
20
|
requestHeaderSchema: AUTH_HEADERS,
|
|
20
21
|
requestPathParamsSchema: DELETE_COMMENT_PATH_PARAMS_SCHEMA,
|
|
@@ -23,7 +24,10 @@ export const deleteCommentContract = defineApiContract({
|
|
|
23
24
|
204: noBodyResponse({ description: 'Comment deleted' }),
|
|
24
25
|
400: ERROR_RESPONSE_SCHEMA,
|
|
25
26
|
401: ERROR_RESPONSE_SCHEMA,
|
|
26
|
-
403:
|
|
27
|
+
403: z.union([
|
|
28
|
+
teamAccessDeniedErrorDefinition.schema,
|
|
29
|
+
commentDeletePermissionRequiredErrorDefinition.schema,
|
|
30
|
+
]),
|
|
27
31
|
404: resourceNotFoundErrorDefinition.schema,
|
|
28
32
|
500: ERROR_RESPONSE_SCHEMA,
|
|
29
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-comment.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/delete-comment.ts"],"names":[],"mappings":"AAAA,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;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CAClD,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;IACrD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,4DAA4D;QAC5D,qGAAqG;IACvG,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,iCAAiC;IAC1D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,EAAE;IACpF,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;QACvD,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;YACX,+BAA+B,CAAC,MAAM;YACtC,8CAA8C,CAAC,MAAM;SACtD,CAAC;QACF,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const commentDeletePermissionRequiredErrorDefinition: {
|
|
2
|
+
readonly code: "COMMENT_DELETE_PERMISSION_REQUIRED";
|
|
3
|
+
readonly type: "permission-denied";
|
|
4
|
+
} & {
|
|
5
|
+
schema: import("zod").ZodObject<{
|
|
6
|
+
message: import("zod").ZodString;
|
|
7
|
+
code: import("zod").ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
8
|
+
errorCode: import("zod").ZodLiteral<"COMMENT_DELETE_PERMISSION_REQUIRED">;
|
|
9
|
+
}, import("zod/v4/core").$strip>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { definePublicError, ErrorType } from '@lokalise/errors';
|
|
2
|
+
// The user is not allowed to delete a comment or reply
|
|
3
|
+
export const commentDeletePermissionRequiredErrorDefinition = definePublicError({
|
|
4
|
+
code: 'COMMENT_DELETE_PERMISSION_REQUIRED',
|
|
5
|
+
type: ErrorType.PERMISSION_DENIED,
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=comment-delete-permission-required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-delete-permission-required.js","sourceRoot":"","sources":["../../../src/api/errors/comment-delete-permission-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE/D,uDAAuD;AACvD,MAAM,CAAC,MAAM,8CAA8C,GAAG,iBAAiB,CAAC;IAC9E,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,SAAS,CAAC,iBAAiB;CAClC,CAAC,CAAA"}
|
package/dist/api/errors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|