@permaweb/libs 0.0.62 → 0.0.64

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.
@@ -10,9 +10,9 @@ export type DependencyType = {
10
10
  };
11
11
  export type ProcessReadType = {
12
12
  processId: string;
13
- path: string;
13
+ path?: string;
14
14
  fallbackAction: string;
15
- serialize?: boolean;
15
+ tags?: TagType[];
16
16
  };
17
17
  export type ProcessSpawnType = {
18
18
  module: string;
@@ -221,12 +221,15 @@ export type BatchAGQLResponseType = {
221
221
  export type ModerationStatusType = 'blocked' | 'allowed';
222
222
  export type ModerationTargetType = 'comment' | 'profile';
223
223
  export type ModerationEntryType = {
224
+ id: string;
224
225
  targetId: string;
226
+ targetType: ModerationTargetType;
225
227
  status: ModerationStatusType;
226
228
  targetContext?: string;
227
229
  reason?: string;
228
230
  moderator: string;
229
231
  dateCreated: number;
232
+ updatedAt?: number;
230
233
  metadata?: any;
231
234
  };
232
235
  export type TagType = {
@@ -1,3 +1,4 @@
1
+ import { TagType } from './types.ts';
1
2
  export declare function checkValidAddress(address: string | null): boolean;
2
3
  export declare function formatAddress(address: string | null, wrap: boolean): string;
3
4
  export declare function getTagValue(list: {
@@ -37,3 +38,4 @@ export declare function getBootTag(key: string, value: string): {
37
38
  value: string;
38
39
  };
39
40
  export declare function isValidMediaData(data: any): any;
41
+ export declare function cleanTagValues(tags: TagType[]): TagType[];
@@ -7,7 +7,6 @@ declare function init(deps: Helpers.DependencyType): {
7
7
  createZone: (args: {
8
8
  data?: any;
9
9
  tags?: Helpers.TagType[];
10
- spawnModeration?: boolean;
11
10
  authUsers?: string[];
12
11
  }, callback?: (status: any) => void) => Promise<string | null>;
13
12
  updateZone: (args: object, zoneId: string) => Promise<string | null>;
@@ -95,7 +94,9 @@ declare function init(deps: Helpers.DependencyType): {
95
94
  getCollections: (args: {
96
95
  creator?: string;
97
96
  }) => Promise<Helpers.CollectionType[] | null>;
98
- addModerationEntry: (zoneId: string, targetType: Helpers.ModerationTargetType, entry: {
97
+ addModerationEntry: (args: {
98
+ moderationId: string;
99
+ targetType: Helpers.ModerationTargetType;
99
100
  targetId: string;
100
101
  status: Helpers.ModerationStatusType;
101
102
  targetContext?: string;
@@ -103,21 +104,39 @@ declare function init(deps: Helpers.DependencyType): {
103
104
  reason?: string;
104
105
  metadata?: any;
105
106
  }) => Promise<string | null>;
106
- getModerationEntries: (zoneId: string, targetType: Helpers.ModerationTargetType, filters?: {
107
+ getModerationEntries: (args: {
108
+ moderationId: string;
109
+ targetType: Helpers.ModerationTargetType;
107
110
  targetId?: string;
108
111
  status?: Helpers.ModerationStatusType;
109
112
  targetContext?: string;
110
113
  moderator?: string;
111
114
  }) => Promise<Helpers.ModerationEntryType[] | null>;
112
- updateModerationEntry: (zoneId: string, targetType: Helpers.ModerationTargetType, targetId: string, update: {
115
+ updateModerationEntry: (args: {
116
+ moderationId: string;
117
+ targetType: Helpers.ModerationTargetType;
118
+ targetId: string;
113
119
  status: Helpers.ModerationStatusType;
114
120
  moderator: string;
115
121
  reason?: string;
116
122
  }) => Promise<string | null>;
117
- removeModerationEntry: (zoneId: string, targetType: Helpers.ModerationTargetType, targetId: string) => Promise<string | null>;
118
- addModerationSubscription: (zoneId: string, moderationId: string, subscriptionType?: string) => Promise<string | null>;
119
- removeModerationSubscription: (zoneId: string, moderationId: string) => Promise<string | null>;
120
- getModerationSubscriptions: (zoneId: string) => Promise<string[] | null>;
123
+ removeModerationEntry: (args: {
124
+ moderationId: string;
125
+ targetType: Helpers.ModerationTargetType;
126
+ targetId: string;
127
+ }) => Promise<string | null>;
128
+ addModerationSubscription: (args: {
129
+ moderationId: string;
130
+ originPortal: string;
131
+ subscriptionType?: string;
132
+ }) => Promise<string | null>;
133
+ removeModerationSubscription: (args: {
134
+ moderationId: string;
135
+ originPortal: string;
136
+ }) => Promise<string | null>;
137
+ getModerationSubscriptions: (args: {
138
+ moderationId: string;
139
+ }) => Promise<string[] | null>;
121
140
  resolveTransaction: (data: any) => Promise<any>;
122
141
  getGQLData: typeof Common.getGQLData;
123
142
  getAggregatedGQLData: typeof Common.getAggregatedGQLData;
@@ -2,7 +2,9 @@ import { DependencyType, ModerationEntryType, ModerationStatusType, ModerationTa
2
2
  /**
3
3
  * Add a moderation entry to the moderation process
4
4
  */
5
- export declare function addModerationEntryWith(deps: DependencyType): (zoneId: string, targetType: ModerationTargetType, entry: {
5
+ export declare function addModerationEntryWith(deps: DependencyType): (args: {
6
+ moderationId: string;
7
+ targetType: ModerationTargetType;
6
8
  targetId: string;
7
9
  status: ModerationStatusType;
8
10
  targetContext?: string;
@@ -13,7 +15,9 @@ export declare function addModerationEntryWith(deps: DependencyType): (zoneId: s
13
15
  /**
14
16
  * Get moderation entries from the moderation process
15
17
  */
16
- export declare function getModerationEntriesWith(deps: DependencyType): (zoneId: string, targetType: ModerationTargetType, filters?: {
18
+ export declare function getModerationEntriesWith(deps: DependencyType): (args: {
19
+ moderationId: string;
20
+ targetType: ModerationTargetType;
17
21
  targetId?: string;
18
22
  status?: ModerationStatusType;
19
23
  targetContext?: string;
@@ -22,7 +26,10 @@ export declare function getModerationEntriesWith(deps: DependencyType): (zoneId:
22
26
  /**
23
27
  * Update a moderation entry in the moderation process
24
28
  */
25
- export declare function updateModerationEntryWith(deps: DependencyType): (zoneId: string, targetType: ModerationTargetType, targetId: string, update: {
29
+ export declare function updateModerationEntryWith(deps: DependencyType): (args: {
30
+ moderationId: string;
31
+ targetType: ModerationTargetType;
32
+ targetId: string;
26
33
  status: ModerationStatusType;
27
34
  moderator: string;
28
35
  reason?: string;
@@ -30,27 +37,43 @@ export declare function updateModerationEntryWith(deps: DependencyType): (zoneId
30
37
  /**
31
38
  * Remove a moderation entry from the moderation process
32
39
  */
33
- export declare function removeModerationEntryWith(deps: DependencyType): (zoneId: string, targetType: ModerationTargetType, targetId: string) => Promise<string | null>;
40
+ export declare function removeModerationEntryWith(deps: DependencyType): (args: {
41
+ moderationId: string;
42
+ targetType: ModerationTargetType;
43
+ targetId: string;
44
+ }) => Promise<string | null>;
34
45
  /**
35
46
  * Add a moderation subscription to the moderation process
36
47
  */
37
- export declare function addModerationSubscriptionWith(deps: DependencyType): (zoneId: string, moderationId: string, subscriptionType?: string) => Promise<string | null>;
48
+ export declare function addModerationSubscriptionWith(deps: DependencyType): (args: {
49
+ moderationId: string;
50
+ originPortal: string;
51
+ subscriptionType?: string;
52
+ }) => Promise<string | null>;
38
53
  /**
39
54
  * Remove a moderation subscription from the moderation process
40
55
  */
41
- export declare function removeModerationSubscriptionWith(deps: DependencyType): (zoneId: string, moderationId: string) => Promise<string | null>;
56
+ export declare function removeModerationSubscriptionWith(deps: DependencyType): (args: {
57
+ moderationId: string;
58
+ originPortal: string;
59
+ }) => Promise<string | null>;
42
60
  /**
43
61
  * Get moderation subscriptions from the moderation process
44
62
  */
45
- export declare function getModerationSubscriptionsWith(deps: DependencyType): (zoneId: string) => Promise<string[] | null>;
63
+ export declare function getModerationSubscriptionsWith(deps: DependencyType): (args: {
64
+ moderationId: string;
65
+ }) => Promise<string[] | null>;
46
66
  /**
47
67
  * Bulk add moderation entries to the moderation process
48
68
  */
49
- export declare function bulkAddModerationEntriesWith(deps: DependencyType): (zoneId: string, entries: Array<{
50
- targetType: ModerationTargetType;
51
- targetId: string;
52
- status: ModerationStatusType;
53
- targetContext?: string;
54
- reason?: string;
55
- metadata?: any;
56
- }>) => Promise<string | null>;
69
+ export declare function bulkAddModerationEntriesWith(deps: DependencyType): (args: {
70
+ moderationId: string;
71
+ entries: Array<{
72
+ targetType: ModerationTargetType;
73
+ targetId: string;
74
+ status: ModerationStatusType;
75
+ targetContext?: string;
76
+ reason?: string;
77
+ metadata?: any;
78
+ }>;
79
+ }) => Promise<string | null>;
@@ -2,7 +2,6 @@ import { DependencyType, TagType } from '../helpers/types.ts';
2
2
  export declare function createZoneWith(deps: DependencyType): (args: {
3
3
  data?: any;
4
4
  tags?: TagType[];
5
- spawnModeration?: boolean;
6
5
  authUsers?: string[];
7
6
  }, callback?: (status: any) => void) => Promise<string | null>;
8
7
  export declare function updateZoneWith(deps: DependencyType): (args: object, zoneId: string) => Promise<string | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@permaweb/libs",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -38,6 +38,7 @@
38
38
  "./node": "./dist/index.js"
39
39
  },
40
40
  "scripts": {
41
+ "prepare": "husky install",
41
42
  "clean:install": "rm -rf node_modules package-lock.json || true && npm cache clean --force && npm install",
42
43
  "format": "eslint --fix . && npx prettier --write .",
43
44
  "build": "node build.js"
@@ -60,7 +61,9 @@
60
61
  "eslint": "^8.35.0",
61
62
  "eslint-plugin-import": "^2.27.5",
62
63
  "eslint-plugin-simple-import-sort": "^10.0.0",
64
+ "husky": "^9.1.7",
63
65
  "os-browserify": "^0.3.0",
66
+ "prettier": "^3.6.2",
64
67
  "process": "^0.11.10",
65
68
  "stream-browserify": "^3.0.0",
66
69
  "tsc-alias": "^1.8.10",