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 1.0.0 #14

Merged
merged 95 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
477923f
Begin: implementing BulkRequest and BulkResponse message classes
sleelin Nov 16, 2021
04be728
Tests(SCIMMY.Messages.BulkOp): add initial suite of unit tests
sleelin Nov 18, 2021
003a66a
Add(SCIMMY.Messages.BulkOp): backbone of 'apply' method
sleelin Nov 19, 2021
c67eccd
Add(SCIMMY.Messages): expose BulkOp implementation
sleelin Nov 19, 2021
b6cd3f4
Tests(SCIMMY.Messages): include BulkOp test suite
sleelin Nov 19, 2021
860d145
Add(SCIMMY.Messages.BulkOp): handling of bulkId including circular re…
sleelin Nov 22, 2021
4bb232a
Tests(SCIMMY.Messages.BulkOp): add fixtures for apply method
sleelin Nov 22, 2021
18190c6
Fix(SCIMMY.Messages.BulkOp): path and data parameter validation anoma…
sleelin Nov 22, 2021
526d0af
Document(SCIMMY.Messages.BulkOp): add failOnErrors parameter JSDoc tag
sleelin Nov 22, 2021
6bea2af
Add(SCIMMY.Messages.BulkResponse): SCIM bulk response message class
sleelin Nov 24, 2021
ab9e524
Refactor(SCIMMY.Messages.BulkOp): begin renaming BulkOp to BulkRequest
sleelin Nov 24, 2021
1d4d025
Refactor(SCIMMY.Messages.BulkOp): end renaming BulkOp to BulkRequest
sleelin Nov 24, 2021
8b57ee3
Chore(SCIMMY.Messages.BulkRequest): fix JSDoc parameter types and mis…
sleelin Nov 24, 2021
bf084aa
Tests(SCIMMY.Messages.BulkResponse): add initial suite of unit tests
sleelin Nov 24, 2021
8eb002a
Add(SCIMMY.Messages.BulkResponse): resolve method for reading new res…
sleelin Nov 24, 2021
78dba6d
Tests(SCIMMY.Messages.BulkResponse): add coverage of resolve method
sleelin Nov 24, 2021
932df76
Chore: bump version to 1.0.0
sleelin Nov 24, 2021
c8511da
Merge pull request #4 from scimmyjs/feature/bulkop
sleelin Nov 24, 2021
0af2d35
Fix(SCIMMY.Messages.PatchOp): replace of nonexistent multivalue targets
sleelin Nov 25, 2021
6016c1b
Tests(SCIMMY.Messages.PatchOp): fixture for replace of nonexistent value
sleelin Nov 25, 2021
255eb4f
Fix(SCIMMY.Messages.BulkRequest): add catch for rejected bulkId promise
sleelin Nov 25, 2021
0e79731
Add(SCIMMY.Messages.SearchRequest): initial implementation of search …
sleelin Nov 26, 2021
2e0beed
Add(SCIMMY.Messages.SearchRequest): apply method for performing search
sleelin Nov 26, 2021
87928ad
Tests(SCIMMY.Messages.SearchRequest): add initial suite of unit tests
sleelin Nov 26, 2021
abf0d69
Add(SCIMMY.Messages.SearchRequest): prepare method so outgoing reques…
sleelin Nov 26, 2021
a84e71b
Tests(SCIMMY.Messages.SearchRequest): basic tests for apply method
sleelin Nov 27, 2021
1c5f7d3
Merge pull request #5 from scimmyjs/feature/searchrequest
sleelin Nov 27, 2021
96ab5ea
Fix(SCIMMY.Resources.User): handle when egress returns undefined
sleelin Nov 27, 2021
229fa1d
Fix(SCIMMY.Resources.Group): handle when egress returns undefined
sleelin Nov 27, 2021
386cd8f
Chore(SCIMMY.Types.Resource): wrong word in explanatory comment
sleelin Nov 27, 2021
a113294
Add(SCIMMY.Types.Attribute): config validation post-instantiation
sleelin Nov 28, 2021
6ac6947
Fix(SCIMMY.Types.Filter): don't split path in namespaces
sleelin Nov 29, 2021
54a2b32
Add(SCIMMY.Types.SchemaDefinition): filtering with namespaced attribu…
sleelin Nov 29, 2021
6d7f7b5
Tests(SCIMMY.Types.SchemaDefinition): filtering with namespaced attri…
sleelin Nov 29, 2021
a906672
Refactor(SCIMMY.Types.Filter): rewrite parser for improved versatility
sleelin Dec 4, 2021
0760cb9
Fix(SCIMMY.Types.Filter): don't strip grouping characters from start …
sleelin Dec 4, 2021
e130320
Tests(SCIMMY.Types.Filter): update format of targets to match expecte…
sleelin Dec 4, 2021
a8aecb1
Tests(SCIMMY.Types.Filter): add more fixtures to improve coverage
sleelin Dec 5, 2021
ce65d86
Add(SCIMMY.Types.Filter): handling of multi-value filters and groups …
sleelin Dec 5, 2021
bee3fad
Chore(SCIMMY.Types.Filter): mark internal methods with private JSDoc tag
sleelin Dec 5, 2021
d05e911
Fix(SCIMMY.Types.Filter): be case-insensitive and handle nested attri…
sleelin Sep 2, 2022
02c2355
Add(SCIMMY.Types.Filter): handling of dates in match method
sleelin Sep 14, 2022
ad0c797
Add(SCIMMY.Types.Filter): handling of multi-valued attributes in matc…
sleelin Sep 15, 2022
7d4841d
Add(SCIMMY.Types.Filter): handling of logical 'and' operations target…
sleelin Sep 16, 2022
3cc442e
Chore(SCIMMY.Messages): fix grammar and titles in documentation
sleelin Mar 30, 2023
1b923dc
Chore(SCIMMY.Types): fix grammar and titles in documentation
sleelin Apr 3, 2023
f2c90de
Chore(SCIMMY.{Config,Resources,Schemas}): fix titles in documentation
sleelin Apr 3, 2023
357cf1c
Chore(deps): bump all devDependencies to latest versions
sleelin Apr 3, 2023
444a253
fix(SCIMMY.Types.SchemaDefinition): missing extension schemas from na…
sleelin Apr 5, 2023
68b4711
Fix(SCIMMY.Messages.PatchOp): also patch inbound attributes
sleelin Apr 5, 2023
e6081d9
Fix(SCIMMY.Messages.PatchOp): rethrow replace op errors when not targ…
sleelin Apr 5, 2023
97ec919
Tests(SCIMMY.Messages): group constructor tests for clarity
sleelin Apr 5, 2023
ad57108
Chore: add c8 for checking test coverage
sleelin Apr 7, 2023
e350bfc
Tests(*): import SCIMMY instead of passing through callback
sleelin Apr 7, 2023
6fb88d0
Tests(SCIMMY.Schemas->.declared()): return 'false' when called with u…
sleelin Apr 7, 2023
3e58b44
Tests(SCIMMY.Types.Resource->.describe()): check properties of return…
sleelin Apr 10, 2023
ff14283
Fix(SCIMMY.Types.Resource->.describe()): find schemaExtensions dynami…
sleelin Apr 10, 2023
a230533
Refactor(SCIMMY.Types.Resource): remove redundant 'extensions' property
sleelin Apr 10, 2023
c27ca06
Fix(SCIMMY.Config): set documentationUri to undefined instead of dele…
sleelin Apr 11, 2023
2675ab8
Tests(SCIMMY.Config->.set()): accepted 'documentationUri' behaviour
sleelin Apr 11, 2023
c6c043c
Tests: add mocking and isolation, enable parallel execution
sleelin Apr 13, 2023
f8f4395
Fix(SCIMMY.Resources.{User,Group}): rethrow errors in 'dispose'
sleelin Apr 14, 2023
681b6ff
Tests(SCIMMY.Resources.*): fix import ordering
sleelin Apr 14, 2023
89bff4c
Tests(SCIMMY.Schemas.*): fix import ordering
sleelin Apr 14, 2023
8144d9b
Tests(SCIMMY.Resources): add coverage for rethrown errors in read/wri…
sleelin Apr 14, 2023
c48ba23
Tests(SCIMMY.Resources->.declare()): add coverage for 'config' argume…
sleelin Apr 14, 2023
afa3810
Tests(SCIMMY.Messages.BulkRequest): isolate and mock Resources
sleelin Apr 14, 2023
0d47f5d
Tests(SCIMMY.Messages.SearchRequest): isolate and mock Resources
sleelin Apr 14, 2023
659c675
Tests(SCIMMY.Messages.SearchRequest): add coverage for singular resou…
sleelin Apr 15, 2023
18c95be
Fix(SCIMMY.Messages.PatchOp): make error handling more consistent
sleelin Apr 17, 2023
f63155c
Tests(SCIMMY.Messages.PatchOp): add coverage for error handling
sleelin Apr 17, 2023
750a0da
Fix(SCIMMY.Messages.BulkRequest): don't wait on preceding ops that re…
sleelin Apr 19, 2023
2e0ba98
Tests(SCIMMY.Messages.BulkRequest->#apply()): error handling coverage
sleelin Apr 19, 2023
1d0e573
Tests(SCIMMY.Types.Filter->#match()): unknown comparator coverage
sleelin Apr 19, 2023
8f2a8c3
Fix(SCIMMY.Types.Resource): make constraints conditions more explicit
sleelin Apr 19, 2023
0f9a4cb
Tests(SCIMMY.Types.Resource): coverage for attributes and constraints…
sleelin Apr 19, 2023
01a5a05
Tests(*): move hooks to separate location
sleelin Apr 20, 2023
bed6c61
Fix(SCIMMY.Types.SchemaDefinition): don't try modify read-only object…
sleelin Apr 24, 2023
899e18a
Tests(SCIMMY.Types.SchemaDefinition): coverage for filtering in coercion
sleelin Apr 24, 2023
fe7066a
Tests(SCIMMY.Types.Attribute): coverage for 'binary' type coercion
sleelin Apr 24, 2023
0160e2c
Tests(SCIMMY.Types.Attribute->#coerce()): coverage for unknown types
sleelin Apr 24, 2023
97ff6d2
Tests(SCIMMY.Types.Attribute->#coerce()): coverage for complex subAtt…
sleelin Apr 24, 2023
f099988
Tests(SCIMMY.Schemas): add coverage for extension attribute cleanup
sleelin Apr 27, 2023
08267ba
Fix(SCIMMY.Types.Schema): support namepath access of complex extensio…
sleelin Apr 27, 2023
4d60b99
Add(SCIMMY.Types.{Attribute,Schema}): toJSON filtering of unreturned …
sleelin Apr 27, 2023
707d313
Tests(SCIMMY.Types.Schema): coverage for toJSON filtering method
sleelin Apr 27, 2023
acfe296
Fix(SCIMMY.Types.Filter): handling of case-sensitive operators and co…
sleelin May 23, 2023
c34584e
Fix(SCIMMY.Types.Filter): parsing of very complex grouped expressions
sleelin May 23, 2023
489b828
Docs(SCIMMY.Types.Filter): extended usage details
sleelin May 23, 2023
a3ba191
Add(SCIMMY.Types.Filter): stringify, clone, and freeze expression obj…
sleelin Jun 7, 2023
0f7b765
Add(SCIMMY.Types.Filter): validate expression objects at instantiation
sleelin Jun 9, 2023
005275f
Fix(SCIMMY.Types.SchemaDefinition): allow removal of extension schema…
sleelin Nov 14, 2023
812f437
Docs(SCIMMY.Schemas): extension schema definition addition and removal
sleelin Nov 14, 2023
41db817
Fix(SCIMMY.Types.Definition): correctly cast arrays when handling nam…
sleelin Nov 15, 2023
8f2fd81
Fix(SCIMMY.Types.Attribute): throw missing required value error for b…
sleelin Nov 15, 2023
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
7 changes: 5 additions & 2 deletions jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"plugins": ["plugins/markdown"],
"plugins": [
"plugins/markdown",
"classy-template/plugin"
],
"source": {
"include": ["src"]
},
"opts": {
"recurse": true,
"template": "./node_modules/classy-template",
"template": "classy-template",
"destination": "./docs",
"readme": "./README.md",
"package": "./package.json"
Expand Down
35 changes: 27 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "scimmy",
"description": "SCIMMY - SCIM m(ade eas)y",
"version": "0.10.0",
"version": "1.0.0",
"author": "sleelin",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -37,16 +37,35 @@
"type": "git",
"url": "git+https://github.com/scimmyjs/scimmy.git"
},
"imports": {
"#@/*": {
"default": "./src/*"
}
},
"c8": {
"all": true,
"check-coverage": true,
"include": [
"src/**/*.js"
],
"reporter": [
"clover",
"lcov"
]
},
"bugs": {
"url": "https://github.com/scimmyjs/scimmy/issues"
},
"devDependencies": {
"chalk": "^4.1.2",
"classy-template": "^1.0.2",
"jsdoc": "^3.6.7",
"minimist": "^1.2.5",
"mocha": "^9.1.3",
"rollup": "^2.60.0",
"typescript": "^4.4.4"
"@types/node": "^18.15.11",
"c8": "^7.13.0",
"chalk": "^5.2.0",
"classy-template": "^1.2.0",
"jsdoc": "^4.0.2",
"minimist": "^1.2.8",
"mocha": "^10.2.0",
"rollup": "^3.20.2",
"sinon": "^15.0.3",
"typescript": "^5.0.2"
}
}
35 changes: 23 additions & 12 deletions packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ const basepath = path.relative(process.cwd(), cwd);
export class Packager {
/**
* Various paths to locations of assets used in packaging process
* @type {{src: string, dist: string}}
* @type {{src: string, dist: string, test: string}}
*/
static paths = {
src: `./${path.join(basepath, "src")}`,
dist: `./${path.join(basepath, "dist")}`
dist: `./${path.join(basepath, "dist")}`,
test: `./${path.join(basepath, "test")}`
};

/**
Expand All @@ -40,7 +41,7 @@ export class Packager {

/**
* Create a step function to consistently log action's results
* @param {Boolean} verbose - whether or not to show extended info about action's results
* @param {Boolean} verbose - whether to show extended info about action's results
* @returns {Function} step function
*/
static action(verbose = true) {
Expand Down Expand Up @@ -103,7 +104,7 @@ export class Packager {

/**
* Build the SCIMMY library
* @param {Boolean} [verbose=false] - whether or not to show extended output from each step of the build
* @param {Boolean} [verbose=false] - whether to show extended output from each step of the build
* @returns {Promise<void>} a promise that resolves when the build has completed
*/
static async build(verbose = false) {
Expand Down Expand Up @@ -152,16 +153,24 @@ export class Packager {
*/
static async test(filter, reporter = "base") {
const {default: Mocha} = await import("mocha");
let mocha = new Mocha()
.reporter(...(typeof reporter === "object" ? [reporter.name, reporter.options] : [reporter]))
.addFile(`./${path.join(basepath, "./test/scimmy.js")}`)
.grep(`/${filter ?? ".*"}/i`);
const mocha = new Mocha().reporter(...(typeof reporter === "object" ? [reporter.name, reporter.options] : [reporter]));
// Recursively go through directories and find all test files
const find = async (dir) => (await Promise.all((await fs.readdir(dir, {withFileTypes: true}))
// Put files above directories, then go through and find all files recursively
.sort((fa, fb) => -fa.isFile()+fb.isFile())
.map(async (file) => ([file.isFile() && path.join(dir, file.name), ...(file.isDirectory() ? await find(path.join(dir, file.name)) : [])]))))
// Collapse the pyramid and find all actual test files
.flat(Infinity).filter(filename => !!filename && filename.endsWith(".js"));

// Let mocha know about the test files
for (let file of await find(Packager.paths.test)) mocha.addFile(file);

return new Promise((resolve, reject) => {
mocha.grep(`/^${(filter ?? "").split("").map(s => `[${s}]`).join("") ?? ".*"}/i`);
mocha.timeout("2m").loadFilesAsync().then(() => mocha.run()).then((runner) => {
if (reporter === "base") {
let reporter = new Mocha.reporters.Base(runner),
epilogue = reporter.epilogue.bind(reporter);
const reporter = new Mocha.reporters.Base(runner);
const epilogue = reporter.epilogue.bind(reporter);

runner.on("end", () => !!reporter.stats.failures ? reject(epilogue) : resolve(epilogue));
}
Expand All @@ -186,10 +195,12 @@ export class Packager {
const output = [];
const config = {
exports: "auto",
preferConst: true,
manualChunks: chunks,
minifyInternalExports: false,
hoistTransitiveImports: false,
manualChunks: chunks
generatedCode: {
constBindings: true
}
};

// Prepare RollupJS bundle with supplied entry point
Expand Down
11 changes: 6 additions & 5 deletions src/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const catchAll = () => {throw new TypeError("SCIM Configuration can only be chan
const handleTraps = {set: catchAll, deleteProperty: catchAll, defineProperty: catchAll};

/**
* SCIM Service Provider Configuration Container Class
* SCIMMY Service Provider Configuration Class
* @namespace SCIMMY.Config
* @description
* SCIMMY provides a singleton class, `SCIMMY.Config`, that acts as a central store for a SCIM Service Provider's configuration.
Expand Down Expand Up @@ -122,8 +122,9 @@ export default class Config {
*/
static get() {
// Wrap all the things in a proxy!
return new Proxy(Object.entries(Config.#config)
.reduce((res, [key, value]) => (((res[key] = (key === "documentationUri" ? value : new Proxy(value, handleTraps))) || true) && res), {}), handleTraps);
return new Proxy(Object.entries(Config.#config).reduce((res, [key, value]) => Object.assign(res, {
[key]: (key === "documentationUri" ? value : new Proxy(value, handleTraps))
}), {}), handleTraps);
}

/**
Expand All @@ -132,7 +133,7 @@ export default class Config {
* @param {Object} args - the new configuration to apply to the service provider config instance
* @param {String} args - the name of the configuration property to set
* @param {Object|Boolean} args - the new value of the configuration property to set
* @returns {Object|SCIMMY.Config} the updated configuration instance, or the config container class for chaining
* @returns {Object|typeof SCIMMY.Config} the updated configuration instance, or the config container class for chaining
*/
static set(...args) {
// Dereference name and config from supplied parameters
Expand Down Expand Up @@ -163,7 +164,7 @@ export default class Config {

// Assign documentationUri string
if (!!value) Config.#config.documentationUri = Schemas.ServiceProviderConfig.definition.attribute(key).coerce(value);
else delete Config.#config.documentationUri;
else Config.#config.documentationUri = undefined;
} else if (Array.isArray(target)) {
// Target is multi-valued (authenticationSchemes), add coerced values to config, or reset if empty
if (!value || (Array.isArray(value) && value.length === 0)) target.splice(0);
Expand Down
6 changes: 6 additions & 0 deletions src/lib/messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {Error} from "./messages/error.js";
import {ListResponse} from "./messages/listresponse.js";
import {PatchOp} from "./messages/patchop.js";
import {BulkRequest} from "./messages/bulkrequest.js";
import {BulkResponse} from "./messages/bulkresponse.js";
import {SearchRequest} from "./messages/searchrequest.js";

/**
* SCIMMY Messages Container Class
Expand All @@ -13,4 +16,7 @@ export default class Messages {
static Error = Error;
static ListResponse = ListResponse;
static PatchOp = PatchOp;
static BulkRequest = BulkRequest;
static BulkResponse = BulkResponse;
static SearchRequest = SearchRequest;
}
Loading
Loading