Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.8.0 #61

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"error",
"single"
],
"curly": ["warn", "all"],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
Expand Down
9 changes: 9 additions & 0 deletions graphql/mutations/authorization-reset-account.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation authorizationPolicyResetOnAccount(
$authorizationResetData: AccountAuthorizationResetInput!
) {
authorizationPolicyResetOnAccount(
authorizationResetData: $authorizationResetData
) {
id
}
}
9 changes: 0 additions & 9 deletions graphql/mutations/authorization-reset-space.graphql

This file was deleted.

3 changes: 3 additions & 0 deletions graphql/queries/spaces-all-visibilities.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ query spacesAllVisibilities {
spaces(filter: { visibilities: [DEMO, ARCHIVED, ACTIVE] }) {
id
nameID
account {
id
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
query spaceChallengeOpportunities(
query spaceSubspaceSubspaces(
$spaceId: UUID_NAMEID!
$challengeId: UUID_NAMEID!
$subspaceId: UUID_NAMEID!
) {
space(ID: $spaceId) {
id
Expand All @@ -12,7 +12,7 @@ query spaceChallengeOpportunities(
collaboration {
id
}
challenge(ID: $challengeId) {
subspace(ID: $subspaceId) {
id
nameID
profile {
Expand All @@ -26,7 +26,7 @@ query spaceChallengeOpportunities(
type
}
}
opportunities {
subspaces {
nameID
profile {
displayName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
query spaceChallengesCallouts {
query spaceSubspacesCollaboration {
spaces {
id
nameID
Expand All @@ -9,7 +9,7 @@ query spaceChallengesCallouts {
id
}
}
challenges {
subspaces {
id
nameID
collaboration {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
query spaceChallengesCommunities($spaceId: UUID_NAMEID!) {
query spaceSubspacesCommunities($spaceId: UUID_NAMEID!) {
space(ID: $spaceId) {
id
nameID
community {
id
}
challenges {
subspaces {
id
nameID
community {
Expand Down
7 changes: 7 additions & 0 deletions graphql/queries/task.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query task($taskId: UUID!) {
task(id: $taskId) {
status
results
errors
}
}
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alkemio/cli",
"version": "0.7.0",
"version": "0.8.0",
"author": "Alkemio Foundation",
"private": false,
"license": "EUPL-1.2",
Expand All @@ -19,14 +19,13 @@
"lint": "tsc --noEmit && eslint src/**/*.ts{,x}",
"lint:fix": "tsc --noEmit && eslint src/**/*.ts{,x} --fix",
"nodemon": "nodemon",
"delete-space-force": "ts-node-dev src/delete-space-force.ts",
"delete-organization": "ts-node-dev src/delete-organization.ts",
"remove-user-from-organizations": "ts-node-dev src/remove-user-from-organizations.ts",
"authorization-reset-platform": "ts-node-dev src/authorization-reset-platform.ts",
"authorization-reset-with-config": "ts-node-dev src/authorization-reset-all.ts true",
"authorization-reset-all": "ts-node-dev src/authorization-reset-all.ts",
"authorization-reset-all-users": "ts-node-dev src/authorization-reset-all-users.ts",
"authorization-reset-all-spaces": "ts-node-dev src/authorization-reset-all-spaces.ts",
"authorization-reset-all-accounts": "ts-node-dev src/authorization-reset-all-accounts.ts",
"authorization-reset-all-organizations": "ts-node-dev src/authorization-reset-all-organizations.ts",
"authorization-detect-orphaned-credentials-from-users": "ts-node-dev src/orphaned-credentials/authorization-detect-orphaned-credentials-from-users.ts",
"migration-add-default-discussion-callouts": "ts-node-dev src/migration/add-default-discussion-callouts.ts",
Expand All @@ -36,6 +35,9 @@
"prepublishOnly": "npm run build",
"codegen": "graphql-codegen --config codegen.yml",
"prune-orphans": "ts-node-dev src/prune-orphan-data/prune-orphan-data.ts",
"digital-twin-demo": "ts-node-dev src/digital-twin-demo/digital-twin-demo.ts",
"prune-orphans-old": "ts-node-dev src/prune-orphan-data/prune-orphan-data.ts",
"prune-orphans-v2": "ts-node-dev src/prune-orphan-data/prune-orphan-data-v2.ts",
"search-ingestion": "ts-node-dev src/search-ingestion/search-ingestion.ts"
},
"repository": {
Expand All @@ -61,7 +63,7 @@
"ts-node-dev": "^2.0.0"
},
"dependencies": {
"@alkemio/client-lib": "^0.27.0",
"@alkemio/client-lib": "^0.30.4",
"@graphql-codegen/typescript-graphql-request": "^4.5.3",
"@graphql-codegen/typescript-operations": "^2.5.3",
"@types/graphql-upload": "^8.0.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { EntityType, retryFunction, shouldProcessEntity } from './util';

const main = async (useConfig = false) => {
if (process.argv[2]) useConfig = process.argv[2] === 'true';
await resetAllSpaces(useConfig);
await resetAllAccounts(useConfig);
};

export const resetAllSpaces = async (useConfig: boolean) => {
export const resetAllAccounts = async (useConfig: boolean) => {
const logger = createLogger();
const config = createConfigUsingEnvVars();

Expand All @@ -30,7 +30,9 @@ export const resetAllSpaces = async (useConfig: boolean) => {
logger.info(`[${count}] - processing space (${space.nameID})`);

await retryFunction(
alkemioCliClient.authorizationResetSpace({ spaceID: space.id })
alkemioCliClient.authorizationResetAccount({
accountID: space.account.id,
})
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/authorization-reset-all.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { resetAllUsers } from './authorization-reset-all-users';
import { resetAllSpaces } from './authorization-reset-all-spaces';
import { resetAllAccounts } from './authorization-reset-all-accounts';
import { resetAllOrganizations } from './authorization-reset-all-organizations';
import { resetPlatform } from './authorization-reset-platform';

const main = async (useConfig = false) => {
if (process.argv[2]) useConfig = process.argv[2] === 'true';
await resetAllUsers(useConfig);
await resetAllSpaces(useConfig);
await resetAllAccounts(useConfig);
await resetAllOrganizations(useConfig);
await resetPlatform();
};
Expand Down
8 changes: 4 additions & 4 deletions src/client/AlkemioCliClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
Sdk,
getSdk,
OrganizationAuthorizationResetInput,
SpaceAuthorizationResetInput,
UserAuthorizationResetInput,
AccountAuthorizationResetInput,
} from '../generated/graphql';
import { Logger } from 'winston';
import { AlkemioClient, AlkemioClientConfig } from '@alkemio/client-lib';
Expand Down Expand Up @@ -61,10 +61,10 @@ export class AlkemioCliClient {
return result.data;
}

public async authorizationResetSpace(
authorizationResetData: SpaceAuthorizationResetInput
public async authorizationResetAccount(
authorizationResetData: AccountAuthorizationResetInput
) {
const result = await this.sdkClient.authorizationPolicyResetOnSpace({
const result = await this.sdkClient.authorizationPolicyResetOnAccount({
authorizationResetData: authorizationResetData,
});

Expand Down
56 changes: 0 additions & 56 deletions src/delete-space-force.ts

This file was deleted.

30 changes: 30 additions & 0 deletions src/digital-twin-demo/digital-twin-demo.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
query digitalTwinDemo(
$spaceNameID: UUID_NAMEID!
){
space(ID:$spaceNameID) {
id
subspaces {
profile {
displayName
tagline
}
context {
vision
impact
}
collaboration {
callouts {
comments {
messagesCount
}
framing {
profile {
displayName
tagline
}
}
}
}
}
}
}
32 changes: 32 additions & 0 deletions src/digital-twin-demo/digital-twin-demo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { createConfigUsingEnvVars } from '../util/create-config-using-envvars';
import { AlkemioCliClient } from '../client/AlkemioCliClient';
import { createLogger } from '../util/create-logger';

const main = async () => {
await digitalTwinDemo();
};

export const digitalTwinDemo = async () => {
const logger = createLogger();
const config = createConfigUsingEnvVars();

const alkemioCliClient = new AlkemioCliClient(config, logger);
await alkemioCliClient.initialise();
await alkemioCliClient.logUser();
await alkemioCliClient.validateConnection();

const spacesQueryResult = await alkemioCliClient.sdkClient.digitalTwinDemo({
spaceNameID: 'digileefomgeving',
});

const space = spacesQueryResult.data.space;

const subspaces = space.subspaces || [];

logger.info(`...total number of subspaces: ${subspaces.length}`);
logger.info(`...${JSON.stringify(space)}`);
};

main().catch(error => {
console.error(error);
});
10 changes: 10 additions & 0 deletions src/digital-twin-demo/model/spaceMetaInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export class SpaceMetaInfo {
Name = '';
ChallengesCount = 0;
MembersCount = 0;
HostOrgName = '';
HostOrgOwnerName = '';
Visibility = '';
FeatureFlagWhiteboard = false;
FeatureFlagCalloutTemplates = false;
}
Loading
Loading