@logto/cli 1.20.0 → 1.22.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.
@@ -27,8 +27,18 @@ export const getAlterationFiles = async () => {
27
27
  return [];
28
28
  }
29
29
  // We need to copy alteration files to execute in the CLI context to make `slonik` available
30
- await fs.rm(localAlterationDirectory, { force: true, recursive: true });
31
- await fs.cp(alterationDirectory, localAlterationDirectory, { recursive: true });
30
+ // Notice that we don't remove the folder,
31
+ // this ensures that the writabiliy remains (and also allows this to be a separately-mounted directory.
32
+ if (!existsSync(localAlterationDirectory)) {
33
+ await fs.mkdir(localAlterationDirectory, { recursive: true });
34
+ }
35
+ const oldFiles = await fs.readdir(localAlterationDirectory);
36
+ await Promise.all(oldFiles.map(async (file) => fs.rm(path.join(localAlterationDirectory, file), { force: true, recursive: true })));
37
+ const newFiles = await fs.readdir(alterationDirectory);
38
+ await Promise.all(newFiles.map(async (file) => fs.cp(path.join(alterationDirectory, file), path.join(localAlterationDirectory, file), {
39
+ recursive: true,
40
+ preserveTimestamps: true,
41
+ })));
32
42
  const directory = await fs.readdir(localAlterationDirectory);
33
43
  const files = directory.filter((file) => alterationFilenameRegex.test(file));
34
44
  return files
@@ -1,7 +1,8 @@
1
1
  import { readdir, readFile } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { createDefaultAdminConsoleConfig, defaultTenantId, adminTenantId, defaultManagementApi, createAdminDataInAdminTenant, createMeApiInAdminTenant, createDefaultSignInExperience, createAdminTenantSignInExperience, createDefaultAdminConsoleApplication, createCloudApi, createTenantApplicationRole, CloudScope, Roles, UsersRoles, LogtoConfigs, SignInExperiences, Applications, OrganizationUserRelations, getTenantOrganizationId, Users, OrganizationRoleUserRelations, TenantRole, } from '@logto/schemas';
3
+ import { createDefaultAdminConsoleConfig, defaultTenantId, adminTenantId, defaultManagementApi, createAdminDataInAdminTenant, createMeApiInAdminTenant, createDefaultSignInExperience, createAdminTenantSignInExperience, createDefaultAdminConsoleApplication, createCloudApi, createTenantApplicationRole, CloudScope, Roles, UsersRoles, LogtoConfigs, SignInExperiences, Applications, OrganizationUserRelations, getTenantOrganizationId, Users, OrganizationRoleUserRelations, TenantRole, AccountCenters, } from '@logto/schemas';
4
4
  import { getTenantRole } from '@logto/schemas';
5
+ import { createDefaultAccountCenter } from '@logto/schemas/lib/seeds/account-center.js';
5
6
  import { Tenants } from '@logto/schemas/models';
6
7
  import { generateStandardId } from '@logto/shared';
7
8
  import { sql } from '@silverhand/slonik';
@@ -114,6 +115,8 @@ export const seedTables = async (connection, latestTimestamp, isCloud) => {
114
115
  connection.query(insertInto(createDefaultSignInExperience(defaultTenantId, isCloud), SignInExperiences.table)),
115
116
  connection.query(insertInto(createAdminTenantSignInExperience(), SignInExperiences.table)),
116
117
  connection.query(insertInto(createDefaultAdminConsoleApplication(), Applications.table)),
118
+ connection.query(insertInto(createDefaultAccountCenter(defaultTenantId), AccountCenters.table)),
119
+ connection.query(insertInto(createDefaultAccountCenter(adminTenantId), AccountCenters.table)),
117
120
  ]);
118
121
  // The below seed data is for the Logto Cloud only. We put it here for the sack of simplicity.
119
122
  // The data is not harmful for OSS, since they are all admin tenant data. OSS will not use them
@@ -1,6 +1,6 @@
1
1
  export const packageJson = {
2
2
  "name": "@logto/cli",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "Logto CLI.",
5
5
  "author": "Silverhand Inc. <contact@silverhand.io>",
6
6
  "homepage": "https://github.com/logto-io/logto#readme",
@@ -42,10 +42,10 @@ export const packageJson = {
42
42
  "url": "https://github.com/logto-io/logto/issues"
43
43
  },
44
44
  "dependencies": {
45
- "@logto/connector-kit": "workspace:^4.0.0",
45
+ "@logto/connector-kit": "workspace:^4.1.0",
46
46
  "@logto/core-kit": "workspace:^2.5.0",
47
- "@logto/schemas": "workspace:1.20.0",
48
- "@logto/shared": "workspace:^3.1.1",
47
+ "@logto/schemas": "workspace:1.22.0",
48
+ "@logto/shared": "workspace:^3.1.2",
49
49
  "@silverhand/essentials": "^2.9.1",
50
50
  "@silverhand/slonik": "31.0.0-beta.2",
51
51
  "chalk": "^5.3.0",
@@ -78,7 +78,7 @@ export const packageJson = {
78
78
  "eslint": "^8.56.0",
79
79
  "lint-staged": "^15.0.0",
80
80
  "prettier": "^3.0.0",
81
- "sinon": "^18.0.0",
81
+ "sinon": "^19.0.0",
82
82
  "typescript": "^5.5.3",
83
83
  "vitest": "^2.0.0"
84
84
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cli",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "Logto CLI.",
5
5
  "author": "Silverhand Inc. <contact@silverhand.io>",
6
6
  "homepage": "https://github.com/logto-io/logto#readme",
@@ -28,10 +28,10 @@
28
28
  "url": "https://github.com/logto-io/logto/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@logto/connector-kit": "^4.0.0",
31
+ "@logto/connector-kit": "^4.1.0",
32
32
  "@logto/core-kit": "^2.5.0",
33
- "@logto/schemas": "1.20.0",
34
- "@logto/shared": "^3.1.1",
33
+ "@logto/schemas": "1.22.0",
34
+ "@logto/shared": "^3.1.2",
35
35
  "@silverhand/essentials": "^2.9.1",
36
36
  "@silverhand/slonik": "31.0.0-beta.2",
37
37
  "chalk": "^5.3.0",
@@ -64,7 +64,7 @@
64
64
  "eslint": "^8.56.0",
65
65
  "lint-staged": "^15.0.0",
66
66
  "prettier": "^3.0.0",
67
- "sinon": "^18.0.0",
67
+ "sinon": "^19.0.0",
68
68
  "typescript": "^5.5.3",
69
69
  "vitest": "^2.0.0"
70
70
  },