pubky-app-specs 0.5.2 → 0.6.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.
- package/README.md +82 -331
- package/example.js +36 -12
- package/index.cjs +47 -3
- package/index.js +48 -4
- package/package.json +1 -1
- package/pubky_app_specs.d.ts +10 -1
- package/pubky_app_specs_bg.wasm +0 -0
- package/validationLimits.js +40 -1
- package/validationLimits.json +1 -1
package/package.json
CHANGED
package/pubky_app_specs.d.ts
CHANGED
|
@@ -246,6 +246,7 @@ export enum PubkyAppFeedLayout {
|
|
|
246
246
|
Columns = 0,
|
|
247
247
|
Wide = 1,
|
|
248
248
|
Visual = 2,
|
|
249
|
+
List = 3,
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
/**
|
|
@@ -350,11 +351,16 @@ export class PubkyAppPost {
|
|
|
350
351
|
* Creates a new `PubkyAppPost` instance and sanitizes it.
|
|
351
352
|
*/
|
|
352
353
|
constructor(content: string, kind: PubkyAppPostKind, parent?: string | null, embed?: PubkyAppPostEmbed | null, attachments?: string[] | null);
|
|
354
|
+
/**
|
|
355
|
+
* Creates a new lockable `PubkyAppPost` instance and sanitizes it.
|
|
356
|
+
*/
|
|
357
|
+
static new_with_lock(content: string, kind: PubkyAppPostKind, parent?: string | null, embed?: PubkyAppPostEmbed | null, attachments?: string[] | null, lock?: string | null): PubkyAppPost;
|
|
353
358
|
toJson(): any;
|
|
354
359
|
readonly attachments: string[] | undefined;
|
|
355
360
|
readonly content: string;
|
|
356
361
|
readonly embed: PubkyAppPostEmbed | undefined;
|
|
357
362
|
readonly kind: string;
|
|
363
|
+
readonly lock: string | undefined;
|
|
358
364
|
readonly parent: string | undefined;
|
|
359
365
|
}
|
|
360
366
|
|
|
@@ -482,7 +488,10 @@ export class PubkySpecsBuilder {
|
|
|
482
488
|
createFollow(followee_id: string): FollowResult;
|
|
483
489
|
createLastRead(): LastReadResult;
|
|
484
490
|
createMute(mutee_id: string): MuteResult;
|
|
485
|
-
|
|
491
|
+
/**
|
|
492
|
+
* Optional `lock`: `pubky://` URL with a host pointing at a lock server.
|
|
493
|
+
*/
|
|
494
|
+
createPost(content: string, kind: PubkyAppPostKind, parent?: string | null, embed?: PubkyAppPostEmbed | null, attachments?: string[] | null, lock?: string | null): PostResult;
|
|
486
495
|
createTag(uri: string, label: string): TagResult;
|
|
487
496
|
createUser(name: string, bio: string | null | undefined, image: string | null | undefined, links: any, status?: string | null): UserResult;
|
|
488
497
|
/**
|
package/pubky_app_specs_bg.wasm
CHANGED
|
Binary file
|
package/validationLimits.js
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
const limits = {
|
|
2
|
+
"maxBlobSizeBytes": 104857600,
|
|
3
|
+
"maxFileSizeBytes": 104857600,
|
|
4
|
+
"tagLabelMinLength": 1,
|
|
5
|
+
"tagLabelMaxLength": 20,
|
|
6
|
+
"tagInvalidChars": [
|
|
7
|
+
",",
|
|
8
|
+
":",
|
|
9
|
+
" ",
|
|
10
|
+
"\t",
|
|
11
|
+
"\n",
|
|
12
|
+
"\r"
|
|
13
|
+
],
|
|
14
|
+
"userNameMinLength": 3,
|
|
15
|
+
"userNameMaxLength": 50,
|
|
16
|
+
"userBioMaxLength": 160,
|
|
17
|
+
"userImageUrlMaxLength": 300,
|
|
18
|
+
"userLinksMaxCount": 5,
|
|
19
|
+
"userLinkTitleMaxLength": 100,
|
|
20
|
+
"userLinkUrlMaxLength": 300,
|
|
21
|
+
"userStatusMaxLength": 50,
|
|
22
|
+
"postShortContentMaxLength": 2000,
|
|
23
|
+
"postLongContentMaxLength": 50000,
|
|
24
|
+
"postAttachmentsMaxCount": 10,
|
|
25
|
+
"postAttachmentUrlMaxLength": 200,
|
|
26
|
+
"postAllowedAttachmentProtocols": [
|
|
27
|
+
"pubky",
|
|
28
|
+
"http",
|
|
29
|
+
"https"
|
|
30
|
+
],
|
|
31
|
+
"collectionContentMaxLength": 40000,
|
|
32
|
+
"collectionNameMinLength": 1,
|
|
33
|
+
"collectionNameMaxLength": 100,
|
|
34
|
+
"collectionDescriptionMaxLength": 500,
|
|
35
|
+
"collectionItemsMaxCount": 100,
|
|
36
|
+
"fileNameMinLength": 1,
|
|
37
|
+
"fileNameMaxLength": 255,
|
|
38
|
+
"fileSrcMaxLength": 1024,
|
|
39
|
+
"feedTagsMaxCount": 5
|
|
40
|
+
};
|
|
2
41
|
|
|
3
42
|
export const validationLimits = limits;
|
|
4
43
|
export const getValidationLimits = () => JSON.parse(JSON.stringify(limits));
|
package/validationLimits.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"userStatusMaxLength": 50,
|
|
22
22
|
"postShortContentMaxLength": 2000,
|
|
23
23
|
"postLongContentMaxLength": 50000,
|
|
24
|
-
"postAttachmentsMaxCount":
|
|
24
|
+
"postAttachmentsMaxCount": 10,
|
|
25
25
|
"postAttachmentUrlMaxLength": 200,
|
|
26
26
|
"postAllowedAttachmentProtocols": [
|
|
27
27
|
"pubky",
|