@profullstack/sh1pt-migrate 0.0.0-stage → 0.1.15

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 (78) hide show
  1. package/README.md +133 -2
  2. package/dist/apply.d.ts +65 -0
  3. package/dist/apply.d.ts.map +1 -0
  4. package/dist/apply.js +143 -0
  5. package/dist/apply.js.map +1 -0
  6. package/dist/engines/files.d.ts +37 -0
  7. package/dist/engines/files.d.ts.map +1 -0
  8. package/dist/engines/files.js +137 -0
  9. package/dist/engines/files.js.map +1 -0
  10. package/dist/engines/index.d.ts +20 -0
  11. package/dist/engines/index.d.ts.map +1 -0
  12. package/dist/engines/index.js +35 -0
  13. package/dist/engines/index.js.map +1 -0
  14. package/dist/engines/mysql.d.ts +17 -0
  15. package/dist/engines/mysql.d.ts.map +1 -0
  16. package/dist/engines/mysql.js +171 -0
  17. package/dist/engines/mysql.js.map +1 -0
  18. package/dist/engines/object-storage.d.ts +42 -0
  19. package/dist/engines/object-storage.d.ts.map +1 -0
  20. package/dist/engines/object-storage.js +197 -0
  21. package/dist/engines/object-storage.js.map +1 -0
  22. package/dist/engines/postgres.d.ts +34 -0
  23. package/dist/engines/postgres.d.ts.map +1 -0
  24. package/dist/engines/postgres.js +309 -0
  25. package/dist/engines/postgres.js.map +1 -0
  26. package/dist/engines/redis.d.ts +3 -0
  27. package/dist/engines/redis.d.ts.map +1 -0
  28. package/dist/engines/redis.js +87 -0
  29. package/dist/engines/redis.js.map +1 -0
  30. package/dist/engines/sqlite.d.ts +3 -0
  31. package/dist/engines/sqlite.d.ts.map +1 -0
  32. package/dist/engines/sqlite.js +113 -0
  33. package/dist/engines/sqlite.js.map +1 -0
  34. package/dist/exec.d.ts +31 -0
  35. package/dist/exec.d.ts.map +1 -0
  36. package/dist/exec.js +119 -0
  37. package/dist/exec.js.map +1 -0
  38. package/dist/index.d.ts +35 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +31 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/plan.d.ts +115 -0
  43. package/dist/plan.d.ts.map +1 -0
  44. package/dist/plan.js +339 -0
  45. package/dist/plan.js.map +1 -0
  46. package/dist/platforms/index.d.ts +29 -0
  47. package/dist/platforms/index.d.ts.map +1 -0
  48. package/dist/platforms/index.js +51 -0
  49. package/dist/platforms/index.js.map +1 -0
  50. package/dist/platforms/managed.d.ts +41 -0
  51. package/dist/platforms/managed.d.ts.map +1 -0
  52. package/dist/platforms/managed.js +163 -0
  53. package/dist/platforms/managed.js.map +1 -0
  54. package/dist/platforms/railway.d.ts +29 -0
  55. package/dist/platforms/railway.d.ts.map +1 -0
  56. package/dist/platforms/railway.js +135 -0
  57. package/dist/platforms/railway.js.map +1 -0
  58. package/dist/platforms/ssh.d.ts +56 -0
  59. package/dist/platforms/ssh.d.ts.map +1 -0
  60. package/dist/platforms/ssh.js +151 -0
  61. package/dist/platforms/ssh.js.map +1 -0
  62. package/dist/platforms/supabase.d.ts +57 -0
  63. package/dist/platforms/supabase.d.ts.map +1 -0
  64. package/dist/platforms/supabase.js +102 -0
  65. package/dist/platforms/supabase.js.map +1 -0
  66. package/dist/staging.d.ts +27 -0
  67. package/dist/staging.d.ts.map +1 -0
  68. package/dist/staging.js +98 -0
  69. package/dist/staging.js.map +1 -0
  70. package/dist/transforms.d.ts +113 -0
  71. package/dist/transforms.d.ts.map +1 -0
  72. package/dist/transforms.js +179 -0
  73. package/dist/transforms.js.map +1 -0
  74. package/dist/types.d.ts +238 -0
  75. package/dist/types.d.ts.map +1 -0
  76. package/dist/types.js +79 -0
  77. package/dist/types.js.map +1 -0
  78. package/package.json +33 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAwDA,MAAM,CAAC,MAAM,MAAM,GAAqB;IACtC,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,SAAS;IACT,QAAQ;IACR,QAAQ;CACA,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,EAAE,CAAC,CAAC;QACf,KAAK,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAU,EAAE,CAAC;YAC1D,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC7D,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC;IACxF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Platform } from '../types.js';
2
+ import { tursoPlatform } from './managed.js';
3
+ import { railwayPlatform } from './railway.js';
4
+ import { sshPlatform } from './ssh.js';
5
+ import { supabasePlatform } from './supabase.js';
6
+ /**
7
+ * Every platform this build can read from or write to.
8
+ *
9
+ * Direction is not encoded here. A platform declares whether it can be a
10
+ * source, a target or both, and the planner pairs any two — so the number of
11
+ * supported migrations is the number of pairs, not the number of entries.
12
+ */
13
+ export declare const PLATFORMS: ReadonlyArray<Platform<any>>;
14
+ export declare function platformById(id: string): Platform<any> | undefined;
15
+ /** Every platform that can be the left-hand side of a migration. */
16
+ export declare function sources(): ReadonlyArray<Platform<unknown>>;
17
+ /** Every platform that can be the right-hand side. */
18
+ export declare function targets(): ReadonlyArray<Platform<unknown>>;
19
+ /**
20
+ * Whether a pair can move anything at all, and what.
21
+ *
22
+ * The intersection of what the source holds and what the target accepts. An
23
+ * empty intersection is a migration that cannot happen, and saying so takes a
24
+ * millisecond instead of a failed cutover.
25
+ */
26
+ export declare function compatibleKinds(fromId: string, toId: string): string[];
27
+ export { railwayPlatform, sshPlatform, supabasePlatform, tursoPlatform };
28
+ export * from './managed.js';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAqB,aAAa,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAMlD,CAAC;AAGF,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAElE;AAED,oEAAoE;AACpE,wBAAgB,OAAO,IAAI,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAE1D;AAED,sDAAsD;AACtD,wBAAgB,OAAO,IAAI,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAMtE;AAED,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AACzE,cAAc,cAAc,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { MANAGED_PLATFORMS, tursoPlatform } from './managed.js';
2
+ import { railwayPlatform } from './railway.js';
3
+ import { sshPlatform } from './ssh.js';
4
+ import { supabasePlatform } from './supabase.js';
5
+ /**
6
+ * Every platform this build can read from or write to.
7
+ *
8
+ * Direction is not encoded here. A platform declares whether it can be a
9
+ * source, a target or both, and the planner pairs any two — so the number of
10
+ * supported migrations is the number of pairs, not the number of entries.
11
+ */
12
+ // biome-ignore lint/suspicious/noExplicitAny: the registry is heterogeneous by
13
+ // design — each platform has its own config type, and the CLI resolves the
14
+ // right one from a config file at runtime.
15
+ export const PLATFORMS = [
16
+ sshPlatform,
17
+ railwayPlatform,
18
+ supabasePlatform,
19
+ tursoPlatform,
20
+ ...MANAGED_PLATFORMS,
21
+ ];
22
+ // biome-ignore lint/suspicious/noExplicitAny: see above.
23
+ export function platformById(id) {
24
+ return PLATFORMS.find((p) => p.id === id);
25
+ }
26
+ /** Every platform that can be the left-hand side of a migration. */
27
+ export function sources() {
28
+ return PLATFORMS.filter((p) => p.role !== 'target');
29
+ }
30
+ /** Every platform that can be the right-hand side. */
31
+ export function targets() {
32
+ return PLATFORMS.filter((p) => p.role !== 'source');
33
+ }
34
+ /**
35
+ * Whether a pair can move anything at all, and what.
36
+ *
37
+ * The intersection of what the source holds and what the target accepts. An
38
+ * empty intersection is a migration that cannot happen, and saying so takes a
39
+ * millisecond instead of a failed cutover.
40
+ */
41
+ export function compatibleKinds(fromId, toId) {
42
+ const from = platformById(fromId);
43
+ const to = platformById(toId);
44
+ if (!from || !to)
45
+ return [];
46
+ const accepted = new Set(to.supports);
47
+ return from.supports.filter((k) => accepted.has(k));
48
+ }
49
+ export { railwayPlatform, sshPlatform, supabasePlatform, tursoPlatform };
50
+ export * from './managed.js';
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platforms/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAA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AAE,CAAC;AACzE,cAAc,cAAc,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { Platform } from '../types.js';
2
+ /**
3
+ * The managed database and app providers that are, from a migration's point of
4
+ * view, a connection string with a brand on it.
5
+ *
6
+ * Turso, Neon, PlanetScale, Fly, Render, Heroku and Vercel differ enormously
7
+ * as products and barely at all here: each one hands over a DSN (or a database
8
+ * name plus a token) and the engines do the rest. Writing a file per vendor
9
+ * would be six copies of the same twenty lines, so they share one factory and
10
+ * differ only where they actually differ.
11
+ *
12
+ * That is the payoff of the platform/engine split stated concretely. Neon to
13
+ * dedicated, dedicated to Neon, Neon to Supabase and Railway to Neon are all
14
+ * the same two engines; none of them is a code path anyone wrote.
15
+ */
16
+ export interface DsnConfig {
17
+ /** The connection string. Takes precedence over anything else. */
18
+ url?: string;
19
+ /** Name for the resource in the plan. Defaults to the platform id. */
20
+ name?: string;
21
+ }
22
+ export interface TursoConfig {
23
+ database: string;
24
+ authToken?: string;
25
+ }
26
+ export declare const neonPlatform: Platform<DsnConfig>;
27
+ export declare const planetscalePlatform: Platform<DsnConfig>;
28
+ export declare const flyPostgresPlatform: Platform<DsnConfig>;
29
+ export declare const renderPlatform: Platform<DsnConfig>;
30
+ export declare const herokuPlatform: Platform<DsnConfig>;
31
+ export declare const vercelPostgresPlatform: Platform<DsnConfig>;
32
+ /**
33
+ * Turso, which is the one that does not fit the DSN mould.
34
+ *
35
+ * Its CLI works on a database NAME plus an account token rather than a
36
+ * connection string, so it gets a real implementation rather than a factory
37
+ * call. The sqlite engine already knows the difference.
38
+ */
39
+ export declare const tursoPlatform: Platform<TursoConfig>;
40
+ export declare const MANAGED_PLATFORMS: readonly [Platform<DsnConfig>, Platform<DsnConfig>, Platform<DsnConfig>, Platform<DsnConfig>, Platform<DsnConfig>, Platform<DsnConfig>];
41
+ //# sourceMappingURL=managed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed.d.ts","sourceRoot":"","sources":["../../src/platforms/managed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAA6B,MAAM,aAAa,CAAC;AAGlF;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,SAAS;IACxB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkED,eAAO,MAAM,YAAY,qBAQvB,CAAC;AAEH,eAAO,MAAM,mBAAmB,qBAQ9B,CAAC;AAEH,eAAO,MAAM,mBAAmB,qBAM9B,CAAC;AAEH,eAAO,MAAM,cAAc,qBAKzB,CAAC;AAEH,eAAO,MAAM,cAAc,qBAQzB,CAAC;AAEH,eAAO,MAAM,sBAAsB,qBAQjC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CA8C/C,CAAC;AAEF,eAAO,MAAM,iBAAiB,yIAOpB,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { plain, secret } from '../types.js';
2
+ /**
3
+ * Build a platform whose entire job is producing one connection string.
4
+ *
5
+ * `role` defaults to `both`: every one of these can be written to as readily
6
+ * as read from, which is what makes the tool bidirectional without a second
7
+ * implementation.
8
+ */
9
+ function dsnPlatform(spec) {
10
+ return {
11
+ id: spec.id,
12
+ label: spec.label,
13
+ role: spec.role ?? 'both',
14
+ supports: [spec.kind],
15
+ async inventory(ctx, config) {
16
+ const url = config.url ?? ctx.secret(spec.envVar);
17
+ if (!url) {
18
+ throw new Error(`${spec.label} needs a connection string: set ${spec.envVar} or pass url`);
19
+ }
20
+ const name = config.name ?? spec.id;
21
+ return {
22
+ platform: spec.id,
23
+ scope: name,
24
+ resources: [
25
+ {
26
+ kind: spec.kind,
27
+ id: `${spec.id}-${name}`,
28
+ name,
29
+ connection: { url: secret(url) },
30
+ ...(spec.quirks ? { quirks: [...spec.quirks] } : {}),
31
+ },
32
+ ],
33
+ ...(spec.notes ? { notes: [...spec.notes] } : {}),
34
+ };
35
+ },
36
+ async provision(_ctx, resource, config) {
37
+ const url = config.url;
38
+ if (!url)
39
+ throw new Error(`${spec.label} target needs a connection string`);
40
+ if (resource.kind !== spec.kind) {
41
+ throw new Error(`${spec.label} cannot receive a ${resource.kind}`);
42
+ }
43
+ return { ...resource, id: `${spec.id}-${resource.name}`, connection: { url: secret(url) } };
44
+ },
45
+ async check(ctx, config) {
46
+ if (!(config.url ?? ctx.secret(spec.envVar))) {
47
+ throw new Error(`${spec.label}: no connection string (${spec.envVar})`);
48
+ }
49
+ },
50
+ };
51
+ }
52
+ export const neonPlatform = dsnPlatform({
53
+ id: 'neon',
54
+ label: 'Neon',
55
+ kind: 'postgres',
56
+ envVar: 'NEON_DATABASE_URL',
57
+ quirks: [
58
+ 'Neon branches are copy-on-write and do not survive a dump; only the branch you point at is moved',
59
+ ],
60
+ });
61
+ export const planetscalePlatform = dsnPlatform({
62
+ id: 'planetscale',
63
+ label: 'PlanetScale',
64
+ kind: 'mysql',
65
+ envVar: 'PLANETSCALE_DATABASE_URL',
66
+ quirks: [
67
+ 'PlanetScale does not support foreign key constraints in the usual way, so a dump taken here may restore without the constraints a plain MySQL would expect',
68
+ ],
69
+ });
70
+ export const flyPostgresPlatform = dsnPlatform({
71
+ id: 'fly',
72
+ label: 'Fly.io Postgres',
73
+ kind: 'postgres',
74
+ envVar: 'FLY_DATABASE_URL',
75
+ quirks: ['a Fly Postgres is reachable only over the private network unless proxied; run `fly proxy` first'],
76
+ });
77
+ export const renderPlatform = dsnPlatform({
78
+ id: 'render',
79
+ label: 'Render',
80
+ kind: 'postgres',
81
+ envVar: 'RENDER_DATABASE_URL',
82
+ });
83
+ export const herokuPlatform = dsnPlatform({
84
+ id: 'heroku',
85
+ label: 'Heroku Postgres',
86
+ kind: 'postgres',
87
+ envVar: 'HEROKU_DATABASE_URL',
88
+ quirks: [
89
+ 'Heroku rotates DATABASE_URL without warning; resolve it at the moment of use rather than caching it across a long migration',
90
+ ],
91
+ });
92
+ export const vercelPostgresPlatform = dsnPlatform({
93
+ id: 'vercel',
94
+ label: 'Vercel Postgres',
95
+ kind: 'postgres',
96
+ envVar: 'POSTGRES_URL',
97
+ notes: [
98
+ 'Vercel Postgres is Neon underneath; the non-pooling POSTGRES_URL_NON_POOLING is the one a dump wants',
99
+ ],
100
+ });
101
+ /**
102
+ * Turso, which is the one that does not fit the DSN mould.
103
+ *
104
+ * Its CLI works on a database NAME plus an account token rather than a
105
+ * connection string, so it gets a real implementation rather than a factory
106
+ * call. The sqlite engine already knows the difference.
107
+ */
108
+ export const tursoPlatform = {
109
+ id: 'turso',
110
+ label: 'Turso',
111
+ role: 'both',
112
+ supports: ['sqlite'],
113
+ async inventory(ctx, config) {
114
+ if (!config.database)
115
+ throw new Error('Turso needs a database name');
116
+ const token = config.authToken ?? ctx.secret('TURSO_API_TOKEN');
117
+ if (!token)
118
+ throw new Error('Turso needs TURSO_API_TOKEN');
119
+ return {
120
+ platform: 'turso',
121
+ scope: config.database,
122
+ resources: [
123
+ {
124
+ kind: 'sqlite',
125
+ id: `turso-${config.database}`,
126
+ name: config.database,
127
+ connection: { tursoDatabase: plain(config.database), authToken: secret(token) },
128
+ metadata: { platform: 'turso' },
129
+ quirks: [
130
+ 'embedded replicas and their sync state do not move; only the primary database is dumped',
131
+ ],
132
+ },
133
+ ],
134
+ };
135
+ },
136
+ async provision(ctx, resource, config) {
137
+ if (resource.kind !== 'sqlite')
138
+ throw new Error(`Turso cannot receive a ${resource.kind}`);
139
+ const token = config.authToken ?? ctx.secret('TURSO_API_TOKEN');
140
+ if (!token)
141
+ throw new Error('Turso needs TURSO_API_TOKEN');
142
+ return {
143
+ ...resource,
144
+ id: `turso-${config.database}`,
145
+ connection: { tursoDatabase: plain(config.database), authToken: secret(token) },
146
+ metadata: { ...resource.metadata, platform: 'turso' },
147
+ };
148
+ },
149
+ async check(ctx, config) {
150
+ if (!(config.authToken ?? ctx.secret('TURSO_API_TOKEN'))) {
151
+ throw new Error('Turso: no TURSO_API_TOKEN');
152
+ }
153
+ },
154
+ };
155
+ export const MANAGED_PLATFORMS = [
156
+ neonPlatform,
157
+ planetscalePlatform,
158
+ flyPostgresPlatform,
159
+ renderPlatform,
160
+ herokuPlatform,
161
+ vercelPostgresPlatform,
162
+ ];
163
+ //# sourceMappingURL=managed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed.js","sourceRoot":"","sources":["../../src/platforms/managed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAwC5C;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,IAAiB;IACpC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM;QACzB,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;QAErB,KAAK,CAAC,SAAS,CAAC,GAAoB,EAAE,MAAiB;YACrD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,mCAAmC,IAAI,CAAC,MAAM,cAAc,CAAC,CAAC;YAC7F,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACpC,OAAO;gBACL,QAAQ,EAAE,IAAI,CAAC,EAAE;gBACjB,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE;wBACx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CAAC,CAAC;QAChE,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC3D,OAAO;YACL,GAAG,QAAQ;YACX,EAAE,EAAE,SAAS,MAAM,CAAC,QAAQ,EAAE;YAC9B,UAAU,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;YAC/E,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;SACtD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,GAAoB,EAAE,MAAmB;QACnD,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,YAAY;IACZ,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;IACd,cAAc;IACd,sBAAsB;CACd,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Platform, Resource } from '../types.js';
2
+ export interface RailwayConfig {
3
+ projectId: string;
4
+ environmentId?: string;
5
+ /** Overrides the RAILWAY_TOKEN secret when set. */
6
+ token?: string;
7
+ }
8
+ interface GqlVariable {
9
+ name: string;
10
+ value: string;
11
+ }
12
+ /**
13
+ * Recognise a connection string by its scheme.
14
+ *
15
+ * Deliberately not by variable name. `DATABASE_URL` is the convention but
16
+ * plenty of apps use `PG_URL`, `POSTGRES_URI` or something bespoke, and a
17
+ * migration that silently skipped the database because it was called the wrong
18
+ * thing would be the worst possible failure. The scheme is the fact.
19
+ */
20
+ export declare function classifyConnection(value: string): Resource['kind'] | undefined;
21
+ /** Variables whose value is a connection string, deduplicated by target. */
22
+ export declare function connectionsFromVariables(vars: GqlVariable[]): Array<{
23
+ kind: Resource['kind'];
24
+ name: string;
25
+ url: string;
26
+ }>;
27
+ export declare const railwayPlatform: Platform<RailwayConfig>;
28
+ export {};
29
+ //# sourceMappingURL=railway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"railway.d.ts","sourceRoot":"","sources":["../../src/platforms/railway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAsBlF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAcD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,CAM9E;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACnE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAaD;AAED,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,aAAa,CAwFnD,CAAC"}
@@ -0,0 +1,135 @@
1
+ import { plain, secret } from '../types.js';
2
+ /**
3
+ * Railway.
4
+ *
5
+ * A Railway project is services plus volumes plus variables, and the data
6
+ * worth moving hides in the variables: a Postgres service's connection string
7
+ * is `DATABASE_URL` on the services that use it, not something the API hands
8
+ * over as a database object. So the inventory reads variables and recognises
9
+ * connection strings in them, rather than asking for a list of databases that
10
+ * does not exist in that shape.
11
+ *
12
+ * `role: 'both'` — Railway is a perfectly good destination, and "we tried
13
+ * bare metal and went back" is a migration people actually make. Provisioning
14
+ * a service here is not automated: creating billable infrastructure is a
15
+ * decision, and `sh1pt deploy` is where that lives. What this does is resolve
16
+ * an existing service's connection so data can be written into it.
17
+ */
18
+ const API = 'https://backboard.railway.app/graphql/v2';
19
+ async function gql(token, query, variables) {
20
+ const res = await fetch(API, {
21
+ method: 'POST',
22
+ headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
23
+ body: JSON.stringify({ query, variables }),
24
+ });
25
+ const json = (await res.json());
26
+ if (json.errors?.length)
27
+ throw new Error(`Railway: ${json.errors[0].message}`);
28
+ if (!res.ok)
29
+ throw new Error(`Railway HTTP ${res.status}`);
30
+ return json.data;
31
+ }
32
+ /**
33
+ * Recognise a connection string by its scheme.
34
+ *
35
+ * Deliberately not by variable name. `DATABASE_URL` is the convention but
36
+ * plenty of apps use `PG_URL`, `POSTGRES_URI` or something bespoke, and a
37
+ * migration that silently skipped the database because it was called the wrong
38
+ * thing would be the worst possible failure. The scheme is the fact.
39
+ */
40
+ export function classifyConnection(value) {
41
+ if (/^postgres(ql)?:\/\//i.test(value))
42
+ return 'postgres';
43
+ if (/^mysql:\/\//i.test(value))
44
+ return 'mysql';
45
+ if (/^rediss?:\/\//i.test(value))
46
+ return 'redis';
47
+ if (/^libsql:\/\//i.test(value))
48
+ return 'sqlite';
49
+ return undefined;
50
+ }
51
+ /** Variables whose value is a connection string, deduplicated by target. */
52
+ export function connectionsFromVariables(vars) {
53
+ const seen = new Set();
54
+ const out = [];
55
+ for (const v of vars) {
56
+ const kind = classifyConnection(v.value);
57
+ if (!kind)
58
+ continue;
59
+ // The same database is usually injected into several services under the
60
+ // same or different names; moving it once is the point.
61
+ if (seen.has(v.value))
62
+ continue;
63
+ seen.add(v.value);
64
+ out.push({ kind, name: v.name, url: v.value });
65
+ }
66
+ return out;
67
+ }
68
+ export const railwayPlatform = {
69
+ id: 'railway',
70
+ label: 'Railway',
71
+ role: 'both',
72
+ supports: ['postgres', 'mysql', 'redis', 'sqlite', 'files'],
73
+ async inventory(ctx, config) {
74
+ const token = config.token ?? ctx.secret('RAILWAY_TOKEN');
75
+ if (!token)
76
+ throw new Error('Railway needs a RAILWAY_TOKEN');
77
+ if (!config.projectId)
78
+ throw new Error('Railway needs a projectId');
79
+ const data = await gql(token, `query ($id: String!) {
80
+ project(id: $id) {
81
+ name
82
+ services { edges { node { id name } } }
83
+ volumes { edges { node { id name } } }
84
+ }
85
+ }`, { id: config.projectId });
86
+ const resources = [];
87
+ const notes = [];
88
+ for (const edge of data.project.volumes.edges) {
89
+ const v = edge.node;
90
+ resources.push({
91
+ kind: 'files',
92
+ id: `volume-${v.id}`,
93
+ name: v.name,
94
+ // A Railway volume is only reachable from inside a service, so it
95
+ // cannot be rsynced from here. Recorded so the plan shows it and a
96
+ // person decides, rather than being silently dropped.
97
+ connection: { path: plain(v.mountPath ?? '/data') },
98
+ quirks: [
99
+ 'a Railway volume is only reachable from inside its service; copy it out with `railway run` or a one-off container rather than over ssh',
100
+ ],
101
+ });
102
+ }
103
+ for (const edge of data.project.services.edges) {
104
+ const service = edge.node;
105
+ const vars = await gql(token, `query ($projectId: String!, $serviceId: String!, $environmentId: String) {
106
+ variables(projectId: $projectId, serviceId: $serviceId, environmentId: $environmentId) { name value }
107
+ }`, {
108
+ projectId: config.projectId,
109
+ serviceId: service.id,
110
+ environmentId: config.environmentId ?? null,
111
+ }).catch(() => ({ variables: [] }));
112
+ for (const conn of connectionsFromVariables(vars.variables ?? [])) {
113
+ resources.push({
114
+ kind: conn.kind,
115
+ id: `${service.id}-${conn.name}`,
116
+ name: `${service.name}/${conn.name}`,
117
+ connection: { url: secret(conn.url) },
118
+ metadata: { service: service.name, variable: conn.name },
119
+ });
120
+ }
121
+ }
122
+ if (!resources.length) {
123
+ notes.push('No connection strings were found in this project. Either the token cannot read variables, or the databases are referenced another way.');
124
+ }
125
+ ctx.log(`${data.project.name}: ${resources.length} resource(s)`);
126
+ return { platform: 'railway', scope: data.project.name, resources, notes };
127
+ },
128
+ async check(ctx, config) {
129
+ const token = config.token ?? ctx.secret('RAILWAY_TOKEN');
130
+ if (!token)
131
+ throw new Error('Railway needs a RAILWAY_TOKEN');
132
+ await gql(token, `query ($id: String!) { project(id: $id) { id } }`, { id: config.projectId });
133
+ },
134
+ };
135
+ //# sourceMappingURL=railway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"railway.js","sourceRoot":"","sources":["../../src/platforms/railway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,GAAG,GAAG,0CAA0C,CAAC;AAcvD,KAAK,UAAU,GAAG,CAAI,KAAa,EAAE,KAAa,EAAE,SAAkC;IACpF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QACjF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;KAC3C,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAsD,CAAC;IACrF,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,IAAS,CAAC;AACxB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,sBAAsB,CAAC,IA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AAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IACjG,CAAC;CACF,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { Platform } from '../types.js';
2
+ /**
3
+ * A box you own: a VPS, a dedicated server, the thing at the other end of an
4
+ * ssh config entry.
5
+ *
6
+ * This is the platform every "get off the cloud" migration ends at, and the
7
+ * one every "we need managed after all" migration starts from. It is `both`
8
+ * because those are the same code path, which is the entire point of splitting
9
+ * platforms from engines.
10
+ *
11
+ * Unlike a managed provider there is no API to ask what is here, so a box is
12
+ * described rather than discovered. That is not a workaround: a directory on a
13
+ * server has no metadata saying "this is the uploads volume", and guessing
14
+ * from paths would be worse than being told. The description lives in config,
15
+ * which means it is reviewable and it is the same on every run.
16
+ */
17
+ export interface SshConfig {
18
+ host: string;
19
+ user?: string;
20
+ sshKeyPath?: string;
21
+ sshPort?: string;
22
+ /** Databases reachable from this box, usually on loopback. */
23
+ postgres?: Array<{
24
+ name: string;
25
+ url: string;
26
+ }>;
27
+ mysql?: Array<{
28
+ name: string;
29
+ url: string;
30
+ }>;
31
+ sqlite?: Array<{
32
+ name: string;
33
+ path: string;
34
+ }>;
35
+ redis?: Array<{
36
+ name: string;
37
+ url: string;
38
+ dataDir?: string;
39
+ }>;
40
+ /** Directories to move: volumes, docroots, upload trees. */
41
+ files?: Array<{
42
+ name: string;
43
+ path: string;
44
+ }>;
45
+ /** An S3-compatible endpoint running on the box, e.g. MinIO. */
46
+ buckets?: Array<{
47
+ name: string;
48
+ bucket: string;
49
+ endpoint: string;
50
+ accessKeyId: string;
51
+ secretAccessKey: string;
52
+ region?: string;
53
+ }>;
54
+ }
55
+ export declare const sshPlatform: Platform<SshConfig>;
56
+ //# sourceMappingURL=ssh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../src/platforms/ssh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAAwC,MAAM,aAAa,CAAC;A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