Skip to content

Commit 7953a8d

Browse files
committed
chore: delete-user-script
1 parent 028a87e commit 7953a8d

9 files changed

Lines changed: 415 additions & 11 deletions

File tree

nx.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"options": {
119119
"targetName": "nxLint"
120120
},
121-
"include": ["e2e/**/**/*", "packages/**/**/*"]
121+
"include": ["e2e/**/**/*", "packages/**/**/*", "tools/**/**/*"]
122122
},
123123
{
124124
"plugin": "@nx/vite/plugin",
@@ -143,13 +143,10 @@
143143
"generators": {
144144
"@nx/js:library": {
145145
"outDir": "{projectRoot}/dist",
146-
"bundler": "tsc",
147-
"linter": "eslint",
148146
"unitTestRunner": "vitest"
149147
},
150148
"@nx/web:application": {
151149
"style": "css",
152-
"linter": "eslint",
153150
"unitTestRunner": "none",
154151
"e2eTestRunner": "playwright"
155152
}

pnpm-lock.yaml

Lines changed: 110 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import baseConfig from '../../eslint.config.mjs';
2+
3+
export default [
4+
{
5+
ignores: ['**/dist'],
6+
},
7+
...baseConfig,
8+
{
9+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
10+
// Override or add rules here
11+
rules: {},
12+
},
13+
{
14+
files: ['**/*.ts', '**/*.tsx'],
15+
// Override or add rules here
16+
rules: {},
17+
},
18+
{
19+
files: ['**/*.js', '**/*.jsx'],
20+
// Override or add rules here
21+
rules: {},
22+
},
23+
{
24+
files: ['**/*.json'],
25+
rules: {
26+
'@nx/dependency-checks': [
27+
'error',
28+
{
29+
ignoredFiles: [
30+
'{projectRoot}/vite.config.{js,ts,mjs,mts}',
31+
'{projectRoot}/eslint.config.{js,cjs,mjs}',
32+
],
33+
},
34+
],
35+
},
36+
languageOptions: {
37+
parser: await import('jsonc-eslint-parser'),
38+
},
39+
},
40+
{
41+
ignores: ['README.md'],
42+
},
43+
{
44+
ignores: [
45+
'**/*.md',
46+
'LICENSE',
47+
'.babelrc',
48+
'.env*',
49+
'.bin',
50+
'dist',
51+
'.eslintignore',
52+
'docs',
53+
'coverage',
54+
'vite.config.*.timestamp*',
55+
'*tsconfig.tsbuildinfo*',
56+
],
57+
},
58+
];

tools/user-scripts/package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "@forgerock/user-scripts",
3+
"version": "0.0.0",
4+
"private": true,
5+
"description": "User scripts for the Ping JavaScript SDK",
6+
"keywords": [],
7+
"license": "ISC",
8+
"author": "",
9+
"main": "./dist/index.js",
10+
"scripts": {
11+
"build": "pnpm nx nxBuild",
12+
"lint": "pnpm nx nxLint",
13+
"test": "pnpm nx nxTest",
14+
"test:watch": "pnpm nx nxTest --watch"
15+
},
16+
"overrides": {
17+
"@effect/platform": "^0.88.0",
18+
"@effect/platform-node": "^0.90.0",
19+
"effect": "^3.16.0"
20+
},
21+
"dependencies": {
22+
"@effect/platform": "^0.88.0",
23+
"@effect/platform-node": "^0.90.0",
24+
"effect": "^3.16.0"
25+
},
26+
"devDependencies": {
27+
"@effect/language-service": "^0.26.0"
28+
},
29+
"nx": {
30+
"tags": ["scope:tool"],
31+
"targets": {
32+
"build": {
33+
"executor": "@nx/js:tsc",
34+
"outputs": ["{options.outputPath}"],
35+
"options": {
36+
"outputPath": "dist",
37+
"main": "index.js",
38+
"tsConfig": "tsconfig.app.json",
39+
"generatePackageJson": true
40+
}
41+
}
42+
}
43+
}
44+
}

tools/user-scripts/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Effect } from 'effect';
2+
import { UserServer } from './lib/user-scripts.js';
3+
4+
export const deleteUser = (userId: string, accessToken: string) =>
5+
UserServer.pipe(
6+
Effect.flatMap((userService) => userService.deleteUser(userId, accessToken)),
7+
Effect.provide(UserServer.Default),
8+
Effect.runPromise,
9+
);

0 commit comments

Comments
 (0)