@atproto/ozone 0.1.135 → 0.1.137

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/api/moderation/queryEvents.d.ts.map +1 -1
  3. package/dist/api/moderation/queryEvents.js +2 -1
  4. package/dist/api/moderation/queryEvents.js.map +1 -1
  5. package/dist/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.d.ts +4 -0
  6. package/dist/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.d.ts.map +1 -0
  7. package/dist/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.js +17 -0
  8. package/dist/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.js.map +1 -0
  9. package/dist/lexicon/index.d.ts +230 -230
  10. package/dist/lexicon/index.d.ts.map +1 -1
  11. package/dist/lexicon/index.js +687 -687
  12. package/dist/lexicon/index.js.map +1 -1
  13. package/dist/lexicon/lexicons.d.ts +16657 -16649
  14. package/dist/lexicon/lexicons.d.ts.map +1 -1
  15. package/dist/lexicon/lexicons.js +9330 -9326
  16. package/dist/lexicon/lexicons.js.map +1 -1
  17. package/dist/lexicon/types/tools/ozone/moderation/queryEvents.d.ts +2 -0
  18. package/dist/lexicon/types/tools/ozone/moderation/queryEvents.d.ts.map +1 -1
  19. package/dist/mod-service/index.d.ts +1 -0
  20. package/dist/mod-service/index.d.ts.map +1 -1
  21. package/dist/mod-service/index.js +6 -1
  22. package/dist/mod-service/index.js.map +1 -1
  23. package/package.json +7 -7
  24. package/src/api/moderation/queryEvents.ts +2 -0
  25. package/src/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.ts +14 -0
  26. package/src/lexicon/index.ts +1235 -1235
  27. package/src/lexicon/lexicons.ts +9420 -9415
  28. package/src/lexicon/types/tools/ozone/moderation/queryEvents.ts +2 -0
  29. package/src/mod-service/index.ts +7 -0
  30. package/tests/mod-tool.test.ts +140 -0
  31. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atproto/ozone
2
2
 
3
+ ## 0.1.137
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2104d9033`](https://github.com/bluesky-social/atproto/commit/2104d9033e2e1a3a7b821c1f0c5c8ffac5832d59)]:
8
+ - @atproto/lexicon@0.4.14
9
+ - @atproto/api@0.16.4
10
+ - @atproto/xrpc@0.7.3
11
+ - @atproto/xrpc-server@0.9.3
12
+
13
+ ## 0.1.136
14
+
15
+ ### Patch Changes
16
+
17
+ - [#4109](https://github.com/bluesky-social/atproto/pull/4109) [`3156ddf61`](https://github.com/bluesky-social/atproto/commit/3156ddf61519fede9ed148478f082184a1e3242e) Thanks [@foysalit](https://github.com/foysalit)! - Add batchId filter to tools.ozone.moderation.queryEvents endpoint
18
+
19
+ - Updated dependencies [[`3156ddf61`](https://github.com/bluesky-social/atproto/commit/3156ddf61519fede9ed148478f082184a1e3242e), [`331a356ce`](https://github.com/bluesky-social/atproto/commit/331a356ce27ff1d0b24747b0c16f3b54b07a0a12)]:
20
+ - @atproto/api@0.16.3
21
+ - @atproto/lexicon@0.4.13
22
+ - @atproto/xrpc@0.7.2
23
+ - @atproto/xrpc-server@0.9.2
24
+
3
25
  ## 0.1.135
4
26
 
5
27
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"queryEvents.d.ts","sourceRoot":"","sources":["../../../src/api/moderation/queryEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA+DvD"}
1
+ {"version":3,"file":"queryEvents.d.ts","sourceRoot":"","sources":["../../../src/api/moderation/queryEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiEvD"}
@@ -6,7 +6,7 @@ function default_1(server, ctx) {
6
6
  server.tools.ozone.moderation.queryEvents({
7
7
  auth: ctx.authVerifier.modOrAdminToken,
8
8
  handler: async ({ params }) => {
9
- const { subject, limit = 50, cursor, sortDirection = 'desc', types, includeAllUserRecords = false, hasComment, comment, createdBy, createdAfter, createdBefore, addedLabels = [], removedLabels = [], addedTags = [], removedTags = [], reportTypes, collections = [], subjectType, policies, modTool, ageAssuranceState, } = params;
9
+ const { subject, limit = 50, cursor, sortDirection = 'desc', types, includeAllUserRecords = false, hasComment, comment, createdBy, createdAfter, createdBefore, addedLabels = [], removedLabels = [], addedTags = [], removedTags = [], reportTypes, collections = [], subjectType, policies, modTool, ageAssuranceState, batchId, } = params;
10
10
  const db = ctx.db;
11
11
  const modService = ctx.modService(db);
12
12
  const results = await modService.getEvents({
@@ -31,6 +31,7 @@ function default_1(server, ctx) {
31
31
  policies,
32
32
  modTool,
33
33
  ageAssuranceState,
34
+ batchId,
34
35
  });
35
36
  return {
36
37
  encoding: 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../src/api/moderation/queryEvents.ts"],"names":[],"mappings":";;AAIA,4BA+DC;AAjED,kCAAsC;AAEtC,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;QACxC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,eAAe;QACtC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,EAAE,EACV,MAAM,EACN,aAAa,GAAG,MAAM,EACtB,KAAK,EACL,qBAAqB,GAAG,KAAK,EAC7B,UAAU,EACV,OAAO,EACP,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,aAAa,GAAG,EAAE,EAClB,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,EAAE,EAChB,WAAW,EACX,WAAW,GAAG,EAAE,EAChB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,iBAAiB,GAClB,GAAG,MAAM,CAAA;YACV,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAA;YACjB,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;YACrC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC;gBACzC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAY,CAAC,CAAC,CAAC,CAAC,EAAE;gBACnD,OAAO;gBACP,SAAS;gBACT,KAAK;gBACL,MAAM;gBACN,aAAa;gBACb,qBAAqB;gBACrB,UAAU;gBACV,OAAO;gBACP,YAAY;gBACZ,aAAa;gBACb,WAAW;gBACX,SAAS;gBACT,aAAa;gBACb,WAAW;gBACX,WAAW;gBACX,WAAW;gBACX,WAAW;gBACX,QAAQ;gBACR,OAAO;gBACP,iBAAiB;aAClB,CAAC,CAAA;YACF,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACjC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAClC;iBACF;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../src/api/moderation/queryEvents.ts"],"names":[],"mappings":";;AAIA,4BAiEC;AAnED,kCAAsC;AAEtC,mB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AO,CAAC,MAAM;oBACtB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACjC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAClC;iBACF;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=20250813T000000000Z-mod-tool-batch-id-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250813T000000000Z-mod-tool-batch-id-index.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,QAAQ,CAAA;AAEpC,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3D;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.up = up;
4
+ exports.down = down;
5
+ const kysely_1 = require("kysely");
6
+ async function up(db) {
7
+ // Only small percentage of moderation events have a batchId in modTool meta property so we're creating a partial index
8
+ await (0, kysely_1.sql) `
9
+ CREATE INDEX moderation_event_mod_tool_batch_id_idx
10
+ ON moderation_event (("modTool" -> 'meta' ->> 'batchId'))
11
+ WHERE "modTool" #> '{meta,batchId}' IS NOT NULL
12
+ `.execute(db);
13
+ }
14
+ async function down(db) {
15
+ await db.schema.dropIndex('moderation_event_mod_tool_batch_id_idx').execute();
16
+ }
17
+ //# sourceMappingURL=20250813T000000000Z-mod-tool-batch-id-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250813T000000000Z-mod-tool-batch-id-index.js","sourceRoot":"","sources":["../../../src/db/migrations/20250813T000000000Z-mod-tool-batch-id-index.ts"],"names":[],"mappings":";;AAEA,gBAOC;AAED,oBAEC;AAbD,mCAAoC;AAE7B,KAAK,UAAU,EAAE,CAAC,EAAmB;IAC1C,uHAAuH;IACvH,MAAM,IAAA,YAAG,EAAA;;;;GAIR,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACf,CAAC;AAEM,KAAK,UAAU,IAAI,CAAC,EAAmB;IAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,wCAAwC,CAAC,CAAC,OAAO,EAAE,CAAA;AAC/E,CAAC"}