@voltro/plugin-releases 0.84.0 → 0.86.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/dist/schema.js ADDED
@@ -0,0 +1,85 @@
1
+ import { RELEASES_TABLE as e, RELEASE_APPS_TABLE as t, RELEASE_ARTIFACTS_TABLE as n, RELEASE_CHANNELS_TABLE as r, RELEASE_EVENTS_TABLE as i } from "./names.js";
2
+ import { bigint as a, boolean as o, id as s, integer as c, json as l, table as u, text as d, timestamp as f } from "@voltro/database";
3
+ //#region src/schema.ts
4
+ var p = [
5
+ "web",
6
+ "ios",
7
+ "android",
8
+ "macos",
9
+ "windows",
10
+ "linux"
11
+ ], m = [
12
+ "pwa",
13
+ "expo",
14
+ "tauri",
15
+ "electron"
16
+ ], h = u(t, {
17
+ id: s({ prefix: "relapp" }),
18
+ app: d(),
19
+ platform: d(),
20
+ shell: d(),
21
+ revision: c().default(0),
22
+ bundleId: d().nullable(),
23
+ updaterPublicKey: d().nullable(),
24
+ runtimeVersion: d().nullable(),
25
+ createdAt: f().default("now")
26
+ }).index("byReleaseAppTarget", [
27
+ "app",
28
+ "platform",
29
+ "shell"
30
+ ]), g = u(r, {
31
+ id: s({ prefix: "relch" }),
32
+ appId: d(),
33
+ name: d(),
34
+ currentReleaseId: d().nullable(),
35
+ minSupportedVersion: d().nullable(),
36
+ killSwitches: l().nullable(),
37
+ public: o().default(!1),
38
+ allowUnsigned: o().default(!1),
39
+ updatedAt: f().default("now").onUpdate("now")
40
+ }).index("byReleaseChannelApp", ["appId", "name"]), _ = u(e, {
41
+ id: s({ prefix: "rel" }),
42
+ appId: d(),
43
+ channelId: d(),
44
+ version: d(),
45
+ buildId: d().nullable(),
46
+ notes: d().nullable(),
47
+ state: d().default("draft"),
48
+ rolloutPercent: c().default(0),
49
+ rolloutSalt: d(),
50
+ cohorts: l().nullable(),
51
+ createdBy: d().nullable(),
52
+ createdAt: f().default("now"),
53
+ updatedAt: f().default("now").onUpdate("now")
54
+ }).index("byReleaseAppChannel", ["appId", "channelId"]).index("byReleaseVersion", ["appId", "version"]), v = u(n, {
55
+ id: s({ prefix: "relart" }),
56
+ releaseId: d(),
57
+ kind: d(),
58
+ target: d().nullable(),
59
+ url: d(),
60
+ sha256: d(),
61
+ size: a(),
62
+ signature: d().nullable(),
63
+ notarized: o().default(!1),
64
+ assetKey: d().nullable(),
65
+ contentType: d().nullable(),
66
+ createdAt: f().default("now")
67
+ }).index("byReleaseArtifactRelease", ["releaseId"]), y = u(i, {
68
+ id: s({ prefix: "relev" }),
69
+ appId: d(),
70
+ channelId: d().nullable(),
71
+ releaseId: d().nullable(),
72
+ kind: d(),
73
+ reason: d().nullable(),
74
+ actorId: d().nullable(),
75
+ detail: l().nullable(),
76
+ at: f().default("now")
77
+ }).index("byReleaseEventApp", ["appId", "at"]), b = [
78
+ h,
79
+ g,
80
+ _,
81
+ v,
82
+ y
83
+ ];
84
+ //#endregion
85
+ export { e as RELEASES_TABLE, t as RELEASE_APPS_TABLE, n as RELEASE_ARTIFACTS_TABLE, r as RELEASE_CHANNELS_TABLE, i as RELEASE_EVENTS_TABLE, p as RELEASE_PLATFORMS, m as RELEASE_SHELLS, h as releaseAppsTable, v as releaseArtifactsTable, g as releaseChannelsTable, y as releaseEventsTable, b as releaseTables, _ as releasesTable };
@@ -0,0 +1,5 @@
1
+ import { createHash as e } from "node:crypto";
2
+ //#region src/uploadIdentity.server.ts
3
+ var t = (t, n) => "relart_" + e("sha256").update(JSON.stringify([t, n])).digest("hex"), n = (e, t) => e.releaseId === t.releaseId && e.kind === t.kind && e.target === (t.target ?? null) && e.url === t.url && e.sha256 === t.sha256.toLowerCase() && e.size === String(t.size) && e.signature === (t.signature ?? null) && e.notarized === (t.notarized ?? !1) && e.assetKey === (t.assetKey ?? null) && e.contentType === (t.contentType ?? null);
4
+ //#endregion
5
+ export { n as matchesUploadArtifact, t as uploadArtifactId };
package/dist/web.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as e } from "./rollout-CGRKMTfv.js";
2
- import { t } from "./rpc-DeEV8l3U.js";
1
+ import { evaluatePolicy as e } from "./rollout.js";
2
+ import { BASE_NAME as t } from "./rpc.js";
3
3
  import { pluginTag as n } from "@voltro/protocol";
4
4
  import { createElement as r, useEffect as i, useRef as a } from "react";
5
5
  import { usePlatform as o, useSubscription as s } from "@voltro/client";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-releases",
3
- "version": "0.84.0",
3
+ "version": "0.86.0",
4
4
  "description": "Release channels, artefacts and rollouts for the apps a Voltro api serves — the self-hosted update server behind Tauri, Expo OTA, electron-updater and PWA update feeds, with a reactive release policy every client subscribes to.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -48,14 +48,14 @@
48
48
  "node": ">=24.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@voltro/client": "0.84.0",
52
- "@voltro/database": "0.84.0",
53
- "@voltro/logger": "0.84.0",
54
- "@voltro/protocol": "0.84.0",
55
- "@voltro/runtime": "0.84.0"
51
+ "@voltro/client": "0.86.0",
52
+ "@voltro/database": "0.86.0",
53
+ "@voltro/logger": "0.86.0",
54
+ "@voltro/protocol": "0.86.0",
55
+ "@voltro/runtime": "0.86.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "effect": "^3.22.2",
58
+ "effect": "4.0.1",
59
59
  "react": "^19.0.0"
60
60
  },
61
61
  "peerDependenciesMeta": {
@@ -1,226 +0,0 @@
1
- import { ReleaseNotFound as e, ReleaseRefused as t } from "./errors.js";
2
- import { Schema as n } from "effect";
3
- import { defineMutation as r, defineQuery as i } from "@voltro/protocol";
4
- //#region src/names.ts
5
- var a = "_voltro_release_apps", o = "_voltro_release_channels", s = "_voltro_releases", c = "_voltro_release_artifacts", l = "_voltro_release_events", u = "@voltro/plugin-releases", d = "releases:manage", f = n.optional(n.Struct({
6
- id: n.String,
7
- revision: n.Number.pipe(n.int(), n.nonNegative())
8
- })), p = n.Struct({
9
- app: n.String,
10
- channel: n.String,
11
- latestVersion: n.NullOr(n.String),
12
- minSupportedVersion: n.NullOr(n.String),
13
- killSwitches: n.Record({
14
- key: n.String,
15
- value: n.Array(n.String)
16
- }),
17
- rolloutPercent: n.Number,
18
- rolloutSalt: n.NullOr(n.String),
19
- cohorts: n.NullOr(n.Array(n.String))
20
- }), m = i({
21
- name: "releases.policy",
22
- input: n.Struct({
23
- app: n.String,
24
- channel: n.String
25
- }),
26
- output: p,
27
- source: [o, s],
28
- openAccess: "the release policy of a channel is what every client — signed in or not — must evaluate before it may continue; it carries versions and feature keys, no data"
29
- }), h = n.Struct({
30
- id: n.String,
31
- version: n.String,
32
- buildId: n.NullOr(n.String),
33
- state: n.String,
34
- rolloutPercent: n.Number,
35
- channel: n.String,
36
- createdAt: n.String,
37
- artifacts: n.Number,
38
- signed: n.Boolean
39
- }), g = i({
40
- name: "releases.list",
41
- input: n.Struct({ app: n.String }),
42
- output: n.Array(h),
43
- source: [s],
44
- guards: [{ scope: d }]
45
- }), _ = r({
46
- name: "releases.registerApp",
47
- input: n.Struct({
48
- app: n.String,
49
- platform: n.Literal("web", "ios", "android", "macos", "windows", "linux"),
50
- shell: n.Literal("pwa", "expo", "tauri", "electron"),
51
- bundleId: n.optional(n.String),
52
- updaterPublicKey: n.optional(n.String),
53
- runtimeVersion: n.optional(n.String),
54
- channels: n.optional(n.Array(n.String))
55
- }),
56
- output: n.Struct({
57
- id: n.String,
58
- created: n.Boolean
59
- }),
60
- error: t,
61
- guards: [{ scope: d }]
62
- }), v = r({
63
- name: "releases.create",
64
- input: n.Struct({
65
- expectedTarget: f,
66
- app: n.String,
67
- channel: n.String,
68
- version: n.String,
69
- buildId: n.optional(n.String),
70
- notes: n.optional(n.String),
71
- cohorts: n.optional(n.Array(n.String))
72
- }),
73
- output: n.Struct({ id: n.String }),
74
- error: n.Union(t, e),
75
- guards: [{ scope: d }]
76
- }), y = r({
77
- name: "releases.upload",
78
- input: n.Struct({
79
- expectedTarget: f,
80
- releaseId: n.String,
81
- kind: n.String,
82
- target: n.optional(n.String),
83
- url: n.String,
84
- sha256: n.String,
85
- size: n.Number,
86
- signature: n.optional(n.String),
87
- notarized: n.optional(n.Boolean),
88
- assetKey: n.optional(n.String),
89
- contentType: n.optional(n.String)
90
- }),
91
- output: n.Struct({ id: n.String }),
92
- error: n.Union(t, e),
93
- guards: [{ scope: d }]
94
- }), b = r({
95
- name: "releases.promote",
96
- input: n.Struct({
97
- expectedTarget: f,
98
- app: n.String,
99
- version: n.String,
100
- to: n.String,
101
- rolloutPercent: n.optional(n.Number.pipe(n.int()))
102
- }),
103
- output: n.Struct({
104
- channel: n.String,
105
- version: n.String,
106
- rolloutPercent: n.Number
107
- }),
108
- error: n.Union(t, e),
109
- guards: [{ scope: d }]
110
- }), x = r({
111
- name: "releases.rollout",
112
- input: n.Struct({
113
- app: n.String,
114
- channel: n.String,
115
- percent: n.Number.pipe(n.int()),
116
- expectedTarget: f
117
- }),
118
- output: n.Struct({
119
- version: n.String,
120
- rolloutPercent: n.Number
121
- }),
122
- error: n.Union(t, e),
123
- guards: [{ scope: d }]
124
- }), S = r({
125
- name: "releases.rollback",
126
- input: n.Struct({
127
- app: n.String,
128
- channel: n.String,
129
- reason: n.String,
130
- expectedTarget: f
131
- }),
132
- output: n.Struct({ version: n.NullOr(n.String) }),
133
- error: n.Union(t, e),
134
- guards: [{ scope: d }]
135
- }), C = r({
136
- name: "releases.setPolicy",
137
- input: n.Struct({
138
- expectedTarget: f,
139
- app: n.String,
140
- channel: n.String,
141
- minSupportedVersion: n.optional(n.NullOr(n.String)),
142
- killSwitches: n.optional(n.Record({
143
- key: n.String,
144
- value: n.Array(n.String)
145
- })),
146
- reason: n.String
147
- }),
148
- output: p,
149
- error: n.Union(t, e),
150
- guards: [{ scope: d }]
151
- }), w = [
152
- {
153
- tag: "releases.policy",
154
- kind: "query",
155
- import: {
156
- module: "@voltro/plugin-releases/rpc",
157
- name: "policyDescriptor"
158
- }
159
- },
160
- {
161
- tag: "releases.list",
162
- kind: "query",
163
- import: {
164
- module: "@voltro/plugin-releases/rpc",
165
- name: "listDescriptor"
166
- }
167
- },
168
- {
169
- tag: "releases.registerApp",
170
- kind: "mutation",
171
- import: {
172
- module: "@voltro/plugin-releases/rpc",
173
- name: "registerAppDescriptor"
174
- }
175
- },
176
- {
177
- tag: "releases.create",
178
- kind: "mutation",
179
- import: {
180
- module: "@voltro/plugin-releases/rpc",
181
- name: "createDescriptor"
182
- }
183
- },
184
- {
185
- tag: "releases.upload",
186
- kind: "mutation",
187
- import: {
188
- module: "@voltro/plugin-releases/rpc",
189
- name: "uploadDescriptor"
190
- }
191
- },
192
- {
193
- tag: "releases.promote",
194
- kind: "mutation",
195
- import: {
196
- module: "@voltro/plugin-releases/rpc",
197
- name: "promoteDescriptor"
198
- }
199
- },
200
- {
201
- tag: "releases.rollout",
202
- kind: "mutation",
203
- import: {
204
- module: "@voltro/plugin-releases/rpc",
205
- name: "rolloutDescriptor"
206
- }
207
- },
208
- {
209
- tag: "releases.rollback",
210
- kind: "mutation",
211
- import: {
212
- module: "@voltro/plugin-releases/rpc",
213
- name: "rollbackDescriptor"
214
- }
215
- },
216
- {
217
- tag: "releases.setPolicy",
218
- kind: "mutation",
219
- import: {
220
- module: "@voltro/plugin-releases/rpc",
221
- name: "setPolicyDescriptor"
222
- }
223
- }
224
- ];
225
- //#endregion
226
- export { c as _, v as a, b as c, S as d, x as f, a as g, s as h, h as i, _ as l, y as m, p as n, g as o, C as p, d as r, m as s, u as t, w as u, o as v, l as y };