AAE-23572 missing files

This commit is contained in:
Wojciech Duda
2024-07-03 15:55:56 +02:00
parent 2a62c1e2a9
commit 6ddc49f523
13 changed files with 305 additions and 0 deletions

3
.prettierignore Normal file
View File

@@ -0,0 +1,3 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage

5
jest.config.ts Normal file
View File

@@ -0,0 +1,5 @@
import { getJestProjects } from '@nrwl/jest';
export default {
projects: getJestProjects()
};

3
jest.preset.js Normal file
View File

@@ -0,0 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;
module.exports = { ...nxPreset };

View File

@@ -0,0 +1,51 @@
{
"extends": ["../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"],
"rules": {
"no-underscore-dangle": ["warn", { "allowAfterThis": true }],
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "error",
"comma-dangle": "error",
"default-case": "error",
"import/order": "off",
"max-len": [
"error",
{
"code": 240
}
],
"no-bitwise": "off",
"no-duplicate-imports": "error",
"no-multiple-empty-lines": "error",
"no-return-await": "error",
"unicorn/filename-case": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"jsdoc/check-param-names": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-param": "off",
"jsdoc/check-tag-names": "off",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"no-redeclare": "off",
"space-before-function-paren": "off",
"@typescript-eslint/no-empty-interface": "warn"
}
}
]
}

View File

@@ -0,0 +1,7 @@
{
"extensions": ["ts"],
"spec": ["lib/js-api/test/**/*.spec.ts"],
"node-option": [
"loader=ts-node/register"
]
}

52
lib/js-api-old/README.md Normal file
View File

@@ -0,0 +1,52 @@
# Alfresco JavaScript API
JavaScript client API for the Alfresco REST API and Activiti REST API.
## API clients documentation
- [Authentication Api](src/api/auth-rest-api/README.md)
- [Content Api](src/api/content-rest-api/README.md)
- [Model Api](src/api/model-rest-api/README.md)
- [Process Api (AAE)](src/api/activiti-rest-api/README.md)
- [Search Api](src/api/search-rest-api/README.md)
- [Governance Classification Api](src/api/gs-classification-rest-api/README.md)
- [Governance Core Api](src/api/gs-core-rest-api/README.md)
- [Discovery Content API](src/api/discovery-rest-api/README.md)
## Guides
- [Authentication](docs/authentication.md)
- [Calling Custom Endpoints](docs/calling-custom-endpoints.md)
- [Error Events](docs/error-events.md)
- [ECM Examples](docs/ecm-example.md), full docs: [Content API](src/api/content-rest-api/README.md)
- [BPM Examples](docs/bpm-example.md), full docs: [APS 2.X API](src/api/activiti-rest-api/README.md)
## Prerequisites
The minimal supported versions are:
- Alfresco Platform Repository: version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer
- Activiti: 1.5
- Node.js ([Long Term Support](https://nodejs.org/en/) version)
## Installing
Using NPM:
```sh
npm install @alfresco/js-api
```
## Development
To run the build
```sh
npm run build
```
To run the test
```sh
npm run test
```

View File

@@ -0,0 +1,26 @@
{
"name": "@alfresco/js-api-old",
"version": "7.8.0",
"license": "Apache-2.0",
"description": "JavaScript client library for the Alfresco REST API",
"author": "Hyland Software, Inc. and its affiliates",
"keywords": [
"alfresco"
],
"repository": {
"type": "git",
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
},
"bugs": {
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
},
"dependencies": {
"event-emitter": "^0.3.5",
"superagent": "^9.0.1",
"tslib": "^2.6.1"
},
"main": "./index.js",
"typings": "./typings/index.d.ts",
"module": "./esm5/index.js",
"es2015": "./esm2015/index.js"
}

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"importHelpers": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"stripInternal": false,
"target": "es2015",
"outDir": "./.out",
"lib": ["es2018", "dom"],
"typeRoots": ["node_modules/@types"],
"types": []
},
"exclude": [".history", "*/node_modules", "config", "performance", "coverage", "node_modules", "package", "dist", "test"]
}

11
lib/js-api/jest.config.ts Normal file
View File

@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'js-api',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/lib/js-api',
testEnvironment: 'jsdom'
};

51
lib/js-api/project.json Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "js-api",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "lib/js-api",
"projectType": "library",
"prefix": "adf",
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/js-api",
"main": "lib/js-api/src/index.ts",
"tsConfig": "lib/js-api/tsconfig.lib.json",
"assets": ["lib/js-api/*.md"],
"externalBuildTargets": [
"build"
]
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/publish.mjs lib-js-api {args.ver} {args.tag}"
},
"dependsOn": ["build"]
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["lib/js-api/**/*.ts"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "lib/js-api/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": []
}

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts"]
}

View File

@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node", "@types/jest"]
},
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
}

53
tools/scripts/publish.mjs Normal file
View File

@@ -0,0 +1,53 @@
/**
* This is a minimal script to publish your package to "npm".
* This is meant to be used as-is or customize as you see fit.
*
* This script is executed on "dist/path/to/library" as "cwd" by default.
*
* You might need to authenticate with NPM before running this script.
*/
import { readCachedProjectGraph } from '@nrwl/devkit';
import { execSync } from 'child_process';
import { readFileSync, writeFileSync } from 'fs';
import chalk from 'chalk';
function invariant(condition, message) {
if (!condition) {
console.error(chalk.bold.red(message));
process.exit(1);
}
}
// Executing publish script: node path/to/publish.mjs {name} --version {version} --tag {tag}
// Default "tag" to "next" so we won't publish the "latest" tag by accident.
const [, , name, version, tag = 'next'] = process.argv;
// A simple SemVer validation to validate the version
const validVersion = /^\d+\.\d+\.\d+(-\w+\.\d+)?/;
invariant(
version && validVersion.test(version),
`No version provided or version did not match Semantic Versioning, expected: #.#.#-tag.# or #.#.#, got ${version}.`
);
const graph = readCachedProjectGraph();
const project = graph.nodes[name];
invariant(project, `Could not find project "${name}" in the workspace. Is the project.json configured correctly?`);
const outputPath = project.data?.targets?.build?.options?.outputPath;
invariant(outputPath, `Could not find "build.options.outputPath" of project "${name}". Is project.json configured correctly?`);
process.chdir(outputPath);
// Updating the version in "package.json" before publishing
try {
const json = JSON.parse(readFileSync(`package.json`).toString());
json.version = version;
writeFileSync(`package.json`, JSON.stringify(json, null, 2));
} catch (e) {
console.error(chalk.bold.red(`Error reading package.json file from library build output.`));
}
// Execute "npm publish" to publish
execSync(`npm publish --access public --tag ${tag}`);