@qkix/strapi-plugin-rewind 0.1.4 → 0.2.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.
@@ -6,6 +6,7 @@ declare const _default: {
6
6
  findOne(ctx: any): Promise<any>;
7
7
  diff(ctx: any): Promise<any>;
8
8
  preview(ctx: any): Promise<any>;
9
+ pin(ctx: any): Promise<any>;
9
10
  restore(ctx: any): Promise<any>;
10
11
  };
11
12
  };
@@ -6,6 +6,12 @@ declare const version: ({ strapi }: {
6
6
  findOne(ctx: any): Promise<any>;
7
7
  diff(ctx: any): Promise<any>;
8
8
  preview(ctx: any): Promise<any>;
9
+ /**
10
+ * `pinned` is read from the body rather than inferred as a toggle, so that two
11
+ * editors with the panel open cannot flip the same version past each other:
12
+ * each request states the state it wants, and the last one wins visibly.
13
+ */
14
+ pin(ctx: any): Promise<any>;
9
15
  restore(ctx: any): Promise<any>;
10
16
  };
11
17
  export default version;
@@ -112,6 +112,7 @@ declare const _default: {
112
112
  findOne(ctx: any): Promise<any>;
113
113
  diff(ctx: any): Promise<any>;
114
114
  preview(ctx: any): Promise<any>;
115
+ pin(ctx: any): Promise<any>;
115
116
  restore(ctx: any): Promise<any>;
116
117
  };
117
118
  };
@@ -161,6 +162,14 @@ declare const _default: {
161
162
  acquire(name: string, ttlMs: number): Promise<boolean>;
162
163
  release(name: string): Promise<void>;
163
164
  };
165
+ pin: ({ strapi }: {
166
+ strapi: import("@strapi/types/dist/core").Strapi;
167
+ }) => {
168
+ set(versionId: number, pinned: boolean): Promise<{
169
+ id: number;
170
+ pinned: boolean;
171
+ }>;
172
+ };
164
173
  };
165
174
  };
166
175
  export default _default;
@@ -31,5 +31,13 @@ declare const _default: {
31
31
  acquire(name: string, ttlMs: number): Promise<boolean>;
32
32
  release(name: string): Promise<void>;
33
33
  };
34
+ pin: ({ strapi }: {
35
+ strapi: import("@strapi/types/dist/core").Strapi;
36
+ }) => {
37
+ set(versionId: number, pinned: boolean): Promise<{
38
+ id: number;
39
+ pinned: boolean;
40
+ }>;
41
+ };
34
42
  };
35
43
  export default _default;
@@ -0,0 +1,19 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ /**
3
+ * Pinning is the only write an editor makes to the history itself rather than
4
+ * to a document, so it is deliberately the smallest one available: a boolean on
5
+ * a row, no cascade, and no effect beyond prune skipping that row from then on
6
+ * (see `selectExpendable` in ../utils/thinning).
7
+ *
8
+ * It is kept out of the controller so that it can be exercised against a real
9
+ * database in the integration tests, which have no HTTP layer to call.
10
+ */
11
+ declare const pin: ({ strapi }: {
12
+ strapi: Core.Strapi;
13
+ }) => {
14
+ set(versionId: number, pinned: boolean): Promise<{
15
+ id: number;
16
+ pinned: boolean;
17
+ }>;
18
+ };
19
+ export default pin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qkix/strapi-plugin-rewind",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Document version history for Strapi v5 - snapshots on every save, with restore",
5
5
  "strapi": {
6
6
  "kind": "plugin",
@@ -55,8 +55,8 @@
55
55
  "styled-components": "^6.1.17",
56
56
  "typescript": "^5.8.3",
57
57
  "vitest": "^3.2.4",
58
- "@qkix/eslint-config": "0.0.0",
59
58
  "@qkix/strapi-test-harness": "0.0.0",
59
+ "@qkix/eslint-config": "0.0.0",
60
60
  "@qkix/tsconfig": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {