codify-schemas 1.0.75 → 1.0.77

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/.env ADDED
@@ -0,0 +1,2 @@
1
+ NEXT_PUBLIC_SUPABASE_URL=https://kdctbvqvqjfquplxhqrm.supabase.co
2
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtkY3RidnF2cWpmcXVwbHhocXJtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDk5NTM5MTAsImV4cCI6MjA2NTUyOTkxMH0.zPy8X9Ru4brupBG07ClgwnHfKdGG1u9rt9qyxZbOTpI
@@ -3,5 +3,7 @@ export declare enum MessageCmd {
3
3
  VALIDATE = "validate",
4
4
  PLAN = "plan",
5
5
  APPLY = "apply",
6
- SUDO_REQUEST = "sudo_request"
6
+ SUDO_REQUEST = "sudo_request",
7
+ PRESS_KEY_TO_CONTINUE_REQUEST = "press_key_to_continue_request",
8
+ CODIFY_CREDENTIALS_REQUEST = "codify_credentials_request"
7
9
  }
@@ -5,5 +5,7 @@ export var MessageCmd;
5
5
  MessageCmd["PLAN"] = "plan";
6
6
  MessageCmd["APPLY"] = "apply";
7
7
  MessageCmd["SUDO_REQUEST"] = "sudo_request";
8
+ MessageCmd["PRESS_KEY_TO_CONTINUE_REQUEST"] = "press_key_to_continue_request";
9
+ MessageCmd["CODIFY_CREDENTIALS_REQUEST"] = "codify_credentials_request";
8
10
  })(MessageCmd || (MessageCmd = {}));
9
11
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/messages/commands.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2CAA6B,CAAA;AAC/B,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/messages/commands.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2CAA6B,CAAA;IAC7B,6EAA+D,CAAA;IAC/D,uEAAyD,CAAA;AAC3D,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "codify-schemas",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "typings": "dist/index.d.ts",
8
8
  "scripts": {
9
9
  "test": "vitest",
10
- "prepublishOnly": "tsc"
10
+ "prepublishOnly": "tsc",
11
+ "script:upload-plugin": "tsx scripts/upload-resources.ts"
11
12
  },
12
13
  "keywords": [],
13
14
  "author": "",
@@ -19,6 +20,9 @@
19
20
  "@types/node": "20.17.14",
20
21
  "vitest": "^1.4.0",
21
22
  "typescript": "^5.3.3",
22
- "ajv-formats": "^3.0.1"
23
+ "ajv-formats": "^3.0.1",
24
+ "@supabase/supabase-js": "^2.50.0",
25
+ "tsx": "^4.20.3",
26
+ "dotenv": "^16.5.0"
23
27
  }
24
28
  }
@@ -0,0 +1,54 @@
1
+ import 'dotenv/config'
2
+ import CodifySchema from '../src/schemastore/codify-schema.json' with {type: 'json'}
3
+ import {createClient} from "@supabase/supabase-js";
4
+
5
+ /**
6
+ * This is an upload script to upload new resources. Update the codify-schema.json file and
7
+ * run this script. Since it's a worker you'll need to open up the URL before it runs.
8
+ */
9
+
10
+ const client = createClient(
11
+ process.env.NEXT_PUBLIC_SUPABASE_URL!,
12
+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
13
+ );
14
+
15
+ async function main() {
16
+ console.log('Adding default plugin');
17
+ const defaultPlugin = await client.from('registry_plugins').upsert({
18
+ name: 'default',
19
+ }, {onConflict: 'name'})
20
+ .select();
21
+
22
+ const { id: pluginId, name: pluginName } = defaultPlugin.data![0];
23
+ const resources = CodifySchema.items.oneOf;
24
+
25
+ for (const resource of resources) {
26
+ const type = resource.properties.type.const;
27
+
28
+ console.log(`Adding resource ${type}`)
29
+ const resourceRow = await client.from('registry_resources').upsert({
30
+ type,
31
+ plugin_id: pluginId,
32
+ plugin_name: pluginName,
33
+ schema: JSON.stringify(resource),
34
+ }, {onConflict: ['type', 'plugin_id']})
35
+ .select();
36
+
37
+ const { id: resourceId } = resourceRow.data![0];
38
+
39
+ const parameters = Object.entries(resource.properties)
40
+ .filter(([k]) => k !== 'type')
41
+ .map(([key, property]) => ({
42
+ type: property.type,
43
+ name: key,
44
+ resource_id: resourceId,
45
+ schema: property,
46
+ }))
47
+
48
+ await client.from('registry_resource_parameters').upsert(parameters, {onConflict: ['name', 'resource_id']});
49
+ }
50
+
51
+ return new Response('Upload complete');
52
+ }
53
+
54
+ main();
@@ -3,5 +3,7 @@ export enum MessageCmd {
3
3
  VALIDATE = 'validate',
4
4
  PLAN = 'plan',
5
5
  APPLY = 'apply',
6
- SUDO_REQUEST = 'sudo_request'
6
+ SUDO_REQUEST = 'sudo_request',
7
+ PRESS_KEY_TO_CONTINUE_REQUEST = 'press_key_to_continue_request',
8
+ CODIFY_CREDENTIALS_REQUEST = 'codify_credentials_request'
7
9
  }
@@ -575,7 +575,7 @@
575
575
  "uniqueItems": true
576
576
  },
577
577
  "type": {
578
- "const": "git-clone",
578
+ "const": "git-repository",
579
579
  "type": "string"
580
580
  }
581
581
  },
@@ -1074,6 +1074,460 @@
1074
1074
  "type"
1075
1075
  ],
1076
1076
  "additionalProperties": false
1077
+ },
1078
+ {
1079
+ "type": "object",
1080
+ "description": "Install and manage local packages with virtualenv",
1081
+ "properties": {
1082
+ "name": {
1083
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1084
+ "type": "string",
1085
+ "pattern": "^[\\w-]+$"
1086
+ },
1087
+ "dependsOn": {
1088
+ "type": "array",
1089
+ "items": {
1090
+ "type": "string"
1091
+ },
1092
+ "uniqueItems": true
1093
+ },
1094
+ "type": {
1095
+ "const": "virtualenv",
1096
+ "type": "string"
1097
+ }
1098
+ },
1099
+ "additionalProperties": false,
1100
+ "required": [
1101
+ "type"
1102
+ ]
1103
+ },
1104
+ {
1105
+ "type": "object",
1106
+ "description": "Install and manage local packages for a project with virtualenv",
1107
+ "properties": {
1108
+ "dest": {
1109
+ "type": "string",
1110
+ "description": "The directory to create virtualenv at"
1111
+ },
1112
+ "python": {
1113
+ "type": "string",
1114
+ "description": "A path to the python interpreter to use to create the virtualenv. This defaults to the global python3 version."
1115
+ },
1116
+ "noVcsIgnore": {
1117
+ "type": "boolean",
1118
+ "description": "Don't create VCS ignore directive in the destination directory (default: false)"
1119
+ },
1120
+ "systemSitePackages": {
1121
+ "type": "boolean",
1122
+ "description": "Give the virtual environment access to the system site-packages dir (default: false)"
1123
+ },
1124
+ "symlinks": {
1125
+ "type": "boolean",
1126
+ "description": " Try to use symlinks rather than copies (default: true)"
1127
+ },
1128
+ "cwd": {
1129
+ "type": "string",
1130
+ "description": "The cwd to create virtualenv from. This allows a relative path to be used for dest."
1131
+ },
1132
+ "automaticallyInstallRequirementsTxt": {
1133
+ "type": "boolean",
1134
+ "description": "If an requirements.txt is available in the cwd, automatically install it when a virtual env is first created."
1135
+ },
1136
+ "name": {
1137
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1138
+ "type": "string",
1139
+ "pattern": "^[\\w-]+$"
1140
+ },
1141
+ "dependsOn": {
1142
+ "type": "array",
1143
+ "items": {
1144
+ "type": "string"
1145
+ },
1146
+ "uniqueItems": true
1147
+ },
1148
+ "type": {
1149
+ "const": "virtualenv-project",
1150
+ "type": "string"
1151
+ }
1152
+ },
1153
+ "additionalProperties": false,
1154
+ "required": [
1155
+ "dest",
1156
+ "type"
1157
+ ]
1158
+ },
1159
+ {
1160
+ "description": "Install and manage Node dependencies and versions using pnpm.",
1161
+ "type": "object",
1162
+ "properties": {
1163
+ "version": {
1164
+ "type": "string",
1165
+ "description": "A specific version of pnpm to install. (defaults to the latest)"
1166
+ },
1167
+ "globalEnvNodeVersion": {
1168
+ "type": "string",
1169
+ "description": "Set the global node version. Corresponds to pnpm env --global use"
1170
+ },
1171
+ "name": {
1172
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1173
+ "type": "string",
1174
+ "pattern": "^[\\w-]+$"
1175
+ },
1176
+ "dependsOn": {
1177
+ "type": "array",
1178
+ "items": {
1179
+ "type": "string"
1180
+ },
1181
+ "uniqueItems": true
1182
+ },
1183
+ "type": {
1184
+ "const": "pnpm",
1185
+ "type": "string"
1186
+ }
1187
+ },
1188
+ "additionalProperties": false,
1189
+ "required": [
1190
+ "type"
1191
+ ]
1192
+ },
1193
+ {
1194
+ "type": "object",
1195
+ "properties": {
1196
+ "name": {
1197
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1198
+ "type": "string",
1199
+ "pattern": "^[\\w-]+$"
1200
+ },
1201
+ "dependsOn": {
1202
+ "type": "array",
1203
+ "items": {
1204
+ "type": "string"
1205
+ },
1206
+ "uniqueItems": true
1207
+ },
1208
+ "type": {
1209
+ "const": "wait-github-ssh-key",
1210
+ "type": "string"
1211
+ }
1212
+ },
1213
+ "required": [
1214
+ "type"
1215
+ ]
1216
+ },
1217
+ {
1218
+ "type": "object",
1219
+ "description": "Install and manage local packages for a project with venv",
1220
+ "properties": {
1221
+ "envDir": {
1222
+ "type": "string",
1223
+ "description": "A directory to create the environment in."
1224
+ },
1225
+ "systemSitePackages": {
1226
+ "type": "boolean",
1227
+ "description": "Give the virtual environment access to the system site-packages dir."
1228
+ },
1229
+ "symlinks": {
1230
+ "type": "boolean",
1231
+ "description": "Try to use symlinks rather than copies, when symlinks are not the default for the platform."
1232
+ },
1233
+ "copies": {
1234
+ "type": "boolean",
1235
+ "description": "Delete the contents of the environment directory if it already exists, before environment creation."
1236
+ },
1237
+ "clear": {
1238
+ "type": "boolean",
1239
+ "description": "Try to use symlinks rather than copies (default: true)."
1240
+ },
1241
+ "upgrade": {
1242
+ "type": "boolean",
1243
+ "description": "Upgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place."
1244
+ },
1245
+ "withoutPip": {
1246
+ "type": "boolean",
1247
+ "description": "Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default)."
1248
+ },
1249
+ "prompt": {
1250
+ "type": "string",
1251
+ "description": "Provides an alternative prompt prefix for this environment."
1252
+ },
1253
+ "upgradeDeps": {
1254
+ "type": "boolean",
1255
+ "description": "Upgrade core dependencies: pip setuptools to the latest version in PyPI."
1256
+ },
1257
+ "cwd": {
1258
+ "type": "string",
1259
+ "description": "The cwd to create virtualenv from. This allows a relative path to be used for dest."
1260
+ },
1261
+ "automaticallyInstallRequirementsTxt": {
1262
+ "type": "boolean",
1263
+ "description": "If an requirements.txt is available in the cwd, automatically install it when a virtual env is first created."
1264
+ },
1265
+ "name": {
1266
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1267
+ "type": "string",
1268
+ "pattern": "^[\\w-]+$"
1269
+ },
1270
+ "dependsOn": {
1271
+ "type": "array",
1272
+ "items": {
1273
+ "type": "string"
1274
+ },
1275
+ "uniqueItems": true
1276
+ },
1277
+ "type": {
1278
+ "const": "venv-project",
1279
+ "type": "string"
1280
+ }
1281
+ },
1282
+ "additionalProperties": false,
1283
+ "required": [
1284
+ "envDir",
1285
+ "type"
1286
+ ]
1287
+ },
1288
+ {
1289
+ "type": "object",
1290
+ "description": "Install and manage packages using pip",
1291
+ "properties": {
1292
+ "virtualEnv": {
1293
+ "type": "string",
1294
+ "description": "A virtual env to activate before issuing pip commands."
1295
+ },
1296
+ "install": {
1297
+ "type": "array",
1298
+ "description": "Packages to install.",
1299
+ "items": {
1300
+ "oneOf": [
1301
+ {
1302
+ "type": "string"
1303
+ },
1304
+ {
1305
+ "type": "object",
1306
+ "properties": {
1307
+ "name": {
1308
+ "type": "string"
1309
+ },
1310
+ "version": {
1311
+ "type": "string"
1312
+ }
1313
+ },
1314
+ "required": [
1315
+ "name"
1316
+ ]
1317
+ }
1318
+ ]
1319
+ }
1320
+ },
1321
+ "installFiles": {
1322
+ "description": "A list of requirement files to install.",
1323
+ "type": "array",
1324
+ "items": {
1325
+ "type": "string"
1326
+ }
1327
+ },
1328
+ "name": {
1329
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1330
+ "type": "string",
1331
+ "pattern": "^[\\w-]+$"
1332
+ },
1333
+ "dependsOn": {
1334
+ "type": "array",
1335
+ "items": {
1336
+ "type": "string"
1337
+ },
1338
+ "uniqueItems": true
1339
+ },
1340
+ "type": {
1341
+ "const": "pip",
1342
+ "type": "string"
1343
+ }
1344
+ },
1345
+ "additionalProperties": false,
1346
+ "required": [
1347
+ "install",
1348
+ "type"
1349
+ ]
1350
+ },
1351
+ {
1352
+ "type": "object",
1353
+ "description": "Install and manage though pip-tools by installing + uninstalling packages using pip-sync",
1354
+ "properties": {
1355
+ "virtualEnv": {
1356
+ "type": "string",
1357
+ "description": "A virtual env to activate before issuing commands."
1358
+ },
1359
+ "requirementFiles": {
1360
+ "type": "array",
1361
+ "items": {
1362
+ "type": "string"
1363
+ },
1364
+ "description": "A list of requirement files to supply pip-sync."
1365
+ },
1366
+ "cwd": {
1367
+ "type": "string",
1368
+ "description": "The working directory to run commands from. If cwd is supplied, the other parameters can be specified as relative to cwd."
1369
+ },
1370
+ "name": {
1371
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1372
+ "type": "string",
1373
+ "pattern": "^[\\w-]+$"
1374
+ },
1375
+ "dependsOn": {
1376
+ "type": "array",
1377
+ "items": {
1378
+ "type": "string"
1379
+ },
1380
+ "uniqueItems": true
1381
+ },
1382
+ "type": {
1383
+ "const": "pip-sync",
1384
+ "type": "string"
1385
+ }
1386
+ },
1387
+ "additionalProperties": false,
1388
+ "required": [
1389
+ "requirementFiles",
1390
+ "type"
1391
+ ]
1392
+ },
1393
+ {
1394
+ "description": "Install macports and manage packages.",
1395
+ "type": "object",
1396
+ "properties": {
1397
+ "install": {
1398
+ "type": "array",
1399
+ "description": "Installs packages.",
1400
+ "items": {
1401
+ "oneOf": [
1402
+ {
1403
+ "type": "string"
1404
+ },
1405
+ {
1406
+ "type": "object",
1407
+ "properties": {
1408
+ "name": {
1409
+ "type": "string"
1410
+ },
1411
+ "version": {
1412
+ "type": "string"
1413
+ }
1414
+ },
1415
+ "required": [
1416
+ "name"
1417
+ ]
1418
+ }
1419
+ ]
1420
+ }
1421
+ },
1422
+ "name": {
1423
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1424
+ "type": "string",
1425
+ "pattern": "^[\\w-]+$"
1426
+ },
1427
+ "dependsOn": {
1428
+ "type": "array",
1429
+ "items": {
1430
+ "type": "string"
1431
+ },
1432
+ "uniqueItems": true
1433
+ },
1434
+ "type": {
1435
+ "const": "macports",
1436
+ "type": "string"
1437
+ }
1438
+ },
1439
+ "additionalProperties": false,
1440
+ "required": [
1441
+ "type"
1442
+ ]
1443
+ },
1444
+ {
1445
+ "description": "Install and manage packages using NPM.",
1446
+ "type": "object",
1447
+ "properties": {
1448
+ "globalInstall": {
1449
+ "type": "array",
1450
+ "description": "An array of",
1451
+ "items": {
1452
+ "oneOf": [
1453
+ {
1454
+ "type": "string",
1455
+ "description": "Npm packages to install globally"
1456
+ },
1457
+ {
1458
+ "type": "object",
1459
+ "properties": {
1460
+ "name": {
1461
+ "type": "string",
1462
+ "description": "The name of the package to install"
1463
+ },
1464
+ "version": {
1465
+ "type": "string",
1466
+ "description": "The version of package to install"
1467
+ }
1468
+ },
1469
+ "required": [
1470
+ "name"
1471
+ ]
1472
+ }
1473
+ ]
1474
+ }
1475
+ },
1476
+ "name": {
1477
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1478
+ "type": "string",
1479
+ "pattern": "^[\\w-]+$"
1480
+ },
1481
+ "dependsOn": {
1482
+ "type": "array",
1483
+ "items": {
1484
+ "type": "string"
1485
+ },
1486
+ "uniqueItems": true
1487
+ },
1488
+ "type": {
1489
+ "const": "npm",
1490
+ "type": "string"
1491
+ }
1492
+ },
1493
+ "additionalProperties": false,
1494
+ "required": [
1495
+ "type"
1496
+ ]
1497
+ },
1498
+ {
1499
+ "type": "object",
1500
+ "description": "Installs docker.",
1501
+ "properties": {
1502
+ "acceptLicense": {
1503
+ "type": "boolean",
1504
+ "description": "Accepts the license agreement. Defaults to true"
1505
+ },
1506
+ "useCurrentUser": {
1507
+ "type": "boolean",
1508
+ "description": "Use the current user to install docker. Defaults to true"
1509
+ },
1510
+ "name": {
1511
+ "description": "Optional name. Useful for specifying multiple resources of the same type",
1512
+ "type": "string",
1513
+ "pattern": "^[\\w-]+$"
1514
+ },
1515
+ "dependsOn": {
1516
+ "type": "array",
1517
+ "items": {
1518
+ "type": "string"
1519
+ },
1520
+ "uniqueItems": true
1521
+ },
1522
+ "type": {
1523
+ "const": "docker",
1524
+ "type": "string"
1525
+ }
1526
+ },
1527
+ "additionalProperties": false,
1528
+ "required": [
1529
+ "type"
1530
+ ]
1077
1531
  }
1078
1532
  ]
1079
1533
  }
@@ -1,16 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "type": "deno",
6
- "command": "cache",
7
- "problemMatcher": [
8
- "$deno"
9
- ],
10
- "group": "build",
11
- "label": "deno: cache"
12
- }
13
-
14
-
15
- ]
16
- }