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

WIP: Dove deno new #2828

Draft
wants to merge 149 commits into
base: dove-deno-new
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
55d1766
chore: Updated Slack links to Discord links
candicetate Jan 24, 2022
b9dfaee
fix(express): Fix application typings to work with typed configuratio…
daffl Jan 25, 2022
31fbdff
fix(schema): Properly handle resolver errors (#2540)
daffl Jan 25, 2022
3077d2d
fix(queryProperty): allow compound oneOf (#2545)
marshallswain Jan 28, 2022
eb00db5
chore: Update year and remove david-dm badges (#2548)
daffl Jan 30, 2022
ef242bf
chore(dependencies): Update all dependencies and CI Node versions (#2…
daffl Feb 6, 2022
8f9f631
fix(hooks): Allow all built-in hooks to be used the async and regular…
daffl Feb 15, 2022
d828748
chore(release): publish v5.0.0-pre.17
daffl Feb 15, 2022
1e6e322
chore: Update changelog
daffl Feb 15, 2022
98a811a
fix(adapter-tests): Add tests for pagination in multi updates (#2472)
fratzinger Feb 15, 2022
fdb1f35
chore(transport-common): Cxport channel, combined & connection (#2576)
fratzinger Mar 10, 2022
5e8b9a3
chore: add directories to package.json-repository (#2582)
fratzinger Mar 24, 2022
c955696
chore: Update Readmes and add Discord badge
daffl Mar 28, 2022
fcdf524
feat(core): Add app.teardown functionality (#2570)
idaho Mar 28, 2022
1a166f3
feat(core): Finalize app.teardown() functionality (#2584)
daffl Mar 28, 2022
a3c3581
feat(authentication): Add setup method for auth strategies (#1611)
vonagam Mar 30, 2022
ae4ebee
feat(core): Add app.setup and app.teardown hook support (#2585)
daffl Apr 1, 2022
c7612d1
chore: Fix all package types fields and unify test command (#2587)
FossPrime Apr 4, 2022
3c66997
chore(dependencies): Update all dependencies (#2588)
daffl Apr 4, 2022
5bc9d44
feat(transport-commons): add `context.http.response` (#2524)
vonagam Apr 4, 2022
a268f86
feat(configuration): Allow app configuration to be validated against …
daffl Apr 4, 2022
27cc7d0
fix(core): Ensure that dynamically registered services are always set…
daffl Apr 6, 2022
6511e45
fix(schema): result resolver correctly resolves paginated find result…
idaho Apr 11, 2022
c0b7b67
chore(release): publish v5.0.0-pre.18
daffl Apr 11, 2022
0a76bf2
chore: Update changelog
daffl Apr 11, 2022
d719f54
fix(client): Fix @feathersjs/client types field (#2596)
daffl Apr 13, 2022
97313e1
fix(transport-commons): Ensure socket queries are always plain object…
daffl Apr 13, 2022
df28b76
feat(typescript): Improve params and query typeability (#2600)
daffl Apr 20, 2022
77d8fda
chore(tests): Move code coverage reporting to c8 (#2606)
daffl Apr 23, 2022
3b2ca0a
feat(typescript): Improve adapter typings (#2605)
daffl Apr 23, 2022
d7243f2
fix(adapter-tests): Ensure multi tests can run standalone (#2608)
daffl Apr 24, 2022
5b323c3
chore(docs): Update Deno README.md (#2602)
yubaoquan Apr 24, 2022
d85c507
feat(schema): Allow hooks to run resolvers in sequence (#2609)
daffl Apr 24, 2022
eacf1b3
fix(express): Fix typo in types reference in package.json (#2613)
karelklima Apr 25, 2022
2dac771
fix(adapter-commons): Clarify adapter query filtering (#2607)
daffl Apr 27, 2022
9f10bfc
fix(authentication-oauth): Make oAuth authentication work with cookie…
cciocov Apr 29, 2022
6d43734
feat(mongodb): Add feathers-mongodb adapter as @feathersjs/mongodb (#…
daffl May 1, 2022
b345857
fix(authentication-oauth): Fix issue with overriding the default Gran…
cciocov May 1, 2022
8c88643
chore(dependencies): Update all dependencies (#2616)
daffl May 1, 2022
57f3e18
chore(release): publish v5.0.0-pre.19
daffl May 1, 2022
715fb80
chore: Update changelog
daffl May 1, 2022
ae3dddd
fix(authentication-oauth): Don't send origins in Grant's config, as i…
cciocov May 3, 2022
2bbb103
feat(schema): Add querySyntax helper to create full query schemas (#2…
daffl May 4, 2022
386c5e2
fix(configuration): Only validate the initial configuration against t…
daffl May 4, 2022
5640c10
fix(dependencies): Lock monorepo package version numbers (#2623)
daffl May 4, 2022
54de749
chore(release): publish v5.0.0-pre.20
daffl May 4, 2022
06d03e9
fix(schema): Add Combine helper to allow merging schema types that us…
daffl May 17, 2022
afe9a3b
fix(core): Do not throw missing method error for regular hook methods…
daffl May 17, 2022
269fdec
fix(typescript): Make additional types generic to work with extended …
daffl May 18, 2022
26d9e05
feat(schema): Add schema resolver converter functionality (#2640)
daffl May 22, 2022
72b980e
feat(schema): Add resolver for safe external data dispatching (#2641)
daffl May 22, 2022
43d8a08
fix(authentication-oauth): Fix regression using incorrect callback an…
johnheenan May 23, 2022
85527d7
feat(schema): Add resolveAll hook (#2643)
daffl May 23, 2022
ac3baed
chore(release): publish v5.0.0-pre.21
daffl May 23, 2022
86e461b
chore: Update changelog
daffl May 23, 2022
be71fa2
fix(schema): Allows resolveData with different resolvers based on met…
daffl May 24, 2022
e452e02
chore(release): publish v5.0.0-pre.22
daffl May 24, 2022
6a4ed58
chore: Update changelog
daffl May 24, 2022
c606c56
chore: Format code using Prettier and updated ESLint rules (#2647)
daffl May 27, 2022
2e45efc
chore: Make sure all files are properly linted recursively (#2648)
daffl May 27, 2022
145b366
fix(schema): Always resolve dispatch in resolveAll and add getDispatc…
daffl May 28, 2022
940a2b6
fix(schema): remove `default` from queryProperty schemas (#2646)
marshallswain May 28, 2022
532eda0
chore: Remove unnecessary dependencies file and adjust Prettier line …
daffl May 31, 2022
c9b8f74
fix(express): Ensure Express options can be set before configuring RE…
daffl Jun 6, 2022
c138acf
feat(client): Improve client side custom method support (#2654)
daffl Jun 6, 2022
2a485a0
feat(core): Rename async hooks to around hooks, allow usual registrat…
daffl Jun 6, 2022
aa972a9
chore(dependencies): Update all dependencies (#2651)
daffl Jun 6, 2022
a60910b
chore(release): publish v5.0.0-pre.23
daffl Jun 6, 2022
98f4260
chore: Update changelog
daffl Jun 6, 2022
b41279b
feat(authentication-local): Add passwordHash property resolver (#2660)
daffl Jun 7, 2022
f7e87db
fix(schema): Fix dispatch resovler hook to convert actually resolved …
daffl Jun 11, 2022
d8104a1
fix(authentication): Add safe dispatch data for authentication reques…
daffl Jun 11, 2022
cb93bb9
fix(authentication-oauth): Fix bug and properly set Grant defaults (#…
cciocov Jun 11, 2022
7f59ae7
feat(cli): Initial Feathers v5 CLI and Pinion generator (#2578)
daffl Jun 14, 2022
ebac587
feat(cli): Add support for JavaScript to the new CLI (#2668)
daffl Jun 17, 2022
24e4bc0
feat(cli): Add hook generator (#2667)
daffl Jun 18, 2022
5b801b5
feat(cli): Add typed client to a generated app (#2669)
daffl Jun 20, 2022
9380fff
feat(knex): Add KnexJS SQL database adapter to core (#2671)
daffl Jun 20, 2022
0fb2c0f
feat(cli): Add generators for new Knex SQL database adapter (#2673)
daffl Jun 21, 2022
72779fa
chore(release): publish v5.0.0-pre.24
daffl Jun 21, 2022
5b84925
chore: Update changelog
daffl Jun 21, 2022
b773fa5
fix(cli): Generator fixes to work with the new guide (#2674)
daffl Jun 22, 2022
c0ab3b6
chore(release): publish v5.0.0-pre.25
daffl Jun 22, 2022
2085504
chore: Update changelog
daffl Jun 22, 2022
fc4cb74
fix(cli): Fix compilation folders that got mixed up
daffl Jun 22, 2022
0e7553d
chore(release): publish v5.0.0-pre.26
daffl Jun 22, 2022
252c872
chore: Update changelog
daffl Jun 22, 2022
04ce9a5
fix(cli): Fix flaky authentication migration and SQL id schema types …
daffl Jun 22, 2022
56f828f
chore: Remove a unnecessary files
daffl Jun 23, 2022
d114557
feat(cli): Improve generated application folder structure (#2678)
daffl Jun 24, 2022
83aa8f9
feat(cli): Add support for Prettier (#2684)
daffl Jul 3, 2022
45f359d
chore(dependencies): Update all dependencies (#2683)
daffl Jul 3, 2022
247dccb
fix: Freeze the resolver context (#2685)
marshallswain Jul 4, 2022
41b3761
fix(authentication-client): Ensure reAuthenticate works in parallel w…
daffl Jul 13, 2022
716c49a
fix(socketio-client): Make Socket.io client event target compatible (…
daffl Jul 13, 2022
6032742
chore(release): publish v5.0.0-pre.27
daffl Jul 13, 2022
f886640
chore: Update changelog
daffl Jul 13, 2022
fe22615
fix(mongodb): Ensure transactions are used properly in create (#2699)
daffl Jul 19, 2022
1f71d78
fix(knex): Fix PostgreSQL integration issues and run CI tests against…
daffl Jul 19, 2022
160746e
fix(authentication-client): Properly handle missing token error (#2700)
daffl Jul 19, 2022
c19c063
chore(dependencies): Update dependencies (#2707)
daffl Aug 2, 2022
3bb4bf4
chore: Some test improvements for latest MacOS
daffl Aug 2, 2022
8d7e04a
fix(core): Get hooks to work reliably with custom methods (#2714)
daffl Aug 3, 2022
bd55ffb
fix(cli): Improve generated application and client (#2701)
daffl Aug 3, 2022
bf8e54f
chore(release): publish v5.0.0-pre.28
daffl Aug 3, 2022
489de50
chore: Update changelog
daffl Aug 3, 2022
32df759
chore(koa): Add test for custom middleware
daffl Aug 15, 2022
5e8e7c4
fix(socketio): Reinitialize hooks on overriden setup method (#2722)
daffl Aug 17, 2022
0e2a9b3
chore(dependencies): Update all dependencies (#2738)
daffl Aug 30, 2022
0b2def6
fix(schema): Fix for Ajv global collision bug #2681 (#2702)
FossPrime Aug 30, 2022
9231525
feat(authentication-oauth): Koa and transport independent oAuth authe…
daffl Sep 9, 2022
fd218f2
feat: Add CORS support to oAuth, Express, Koa and generated applicati…
daffl Sep 12, 2022
6dd1311
chore(dependencies): Update dependencies (#2747)
daffl Sep 13, 2022
21d6aaa
chore(tests): Fix test running setup
daffl Sep 13, 2022
c7bf80d
feat(cli): Add custom environment variable support to generated appli…
daffl Sep 15, 2022
1d45427
feat(cli): Adding ClientService to CLI (#2750)
daffl Sep 15, 2022
f7e1c33
fix(authentication-oauth): Fix oAuth origin and error handling (#2752)
daffl Sep 15, 2022
4314dc8
chore(release): publish v5.0.0-pre.29
daffl Sep 16, 2022
190d609
chore: Update changelog
daffl Sep 16, 2022
c7e1b7e
feat(cli): Improve CLI interface (#2753)
daffl Sep 16, 2022
bb953ad
chore: Fix ESLint warnings for now
daffl Sep 16, 2022
d734931
feat(cli): Add ability to `npm init feathers` (#2755)
daffl Sep 16, 2022
d16601f
feat(core): Allow to unregister services at runtime (#2756)
daffl Sep 17, 2022
821fc1f
chore(cli): Add syntax highlighting pointers for VSCode to template s…
daffl Sep 26, 2022
ea31f15
chore(build): Move npm package buildpack folder (#2781)
daffl Oct 6, 2022
26a4b95
chore(dependencies): Update all dependencies (#2780)
daffl Oct 6, 2022
ab580cb
fix(core): Ensure setup and teardown can be overriden and maintain ho…
daffl Oct 6, 2022
b1844b1
fix(authentication-oauth): Fix regression with prefix handling in OAu…
nsainaney Oct 6, 2022
44172d9
feat(schema): Make schemas validation library independent and add Typ…
daffl Oct 7, 2022
b535c91
chore(release): publish v5.0.0-pre.30
daffl Oct 7, 2022
d886f33
chore: Update changelog
daffl Oct 7, 2022
474a9fd
feat(cli): Improve generated schema definitions (#2783)
daffl Oct 8, 2022
d3ee41e
fix(koa): Only set error code for Feathers errors (#2793)
daffl Oct 12, 2022
f3ddab6
fix(errors): Allows to pass no error message (#2794)
daffl Oct 12, 2022
57119b6
feat(cli): Generate full client test suite and improve typed client (…
daffl Oct 12, 2022
4500dbe
chore(release): publish v5.0.0-pre.31
daffl Oct 12, 2022
4abe6c5
chore: Update changelog
daffl Oct 12, 2022
164593f
update adapter-commons, commons and errors packages
apollo79 Oct 22, 2022
2207eea
change deno support in vscode
apollo79 Oct 22, 2022
d9b3554
use the old version of events.ts
apollo79 Oct 23, 2022
1a2c8d4
format debug.test.ts and fix typing in service
apollo79 Oct 23, 2022
1444445
port feathers package
apollo79 Oct 23, 2022
4307898
Merge branch 'dove' into dove-deno-new
apollo79 Oct 24, 2022
82dd9d2
port transport-commons package
apollo79 Oct 29, 2022
7a1b148
port adapter-tests
apollo79 Oct 31, 2022
a7dd352
add LICENSE to feathers and transport-commons packages
apollo79 Oct 31, 2022
dea9237
use Array.flat method instead of lodash.flattenDeep
apollo79 Oct 31, 2022
cccacf0
port memory
apollo79 Oct 31, 2022
9864dfc
port schema
apollo79 Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main/
deno/
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true
"deno.unstable": true,
"deno.enablePaths": [
"./main",
"./deno"
]
}
2 changes: 1 addition & 1 deletion main/adapter-commons/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Feathers
Copyright (c) 2022 Feathers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions main/adapter-commons/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/index.ts";
166 changes: 166 additions & 0 deletions main/adapter-commons/src/declarations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import {
Query,
Params,
Paginated,
Id,
NullableId,
} from "../../feathers/mod.ts";

export type FilterQueryOptions = {
filters?: FilterSettings;
operators?: string[];
paginate?: PaginationParams;
};

export type QueryFilter = (value: any, options: FilterQueryOptions) => any;

export type FilterSettings = {
[key: string]: QueryFilter | true;
};

export interface PaginationOptions {
default?: number;
max?: number;
}

export type PaginationParams = false | PaginationOptions;

export interface AdapterServiceOptions {
/**
* Whether to allow multiple updates for everything (`true`) or specific methods (e.g. `['create', 'remove']`)
*/
multi?: boolean | string[];
/**
* The name of the id property
*/
id?: string;
/**
* Pagination settings for this service
*/
paginate?: PaginationParams;
/**
* A list of additional property query operators to allow in a query
*/
operators?: string[];
/**
* An object of additional top level query filters, e.g. `{ $populate: true }`
* Can also be a converter function like `{ $ignoreCase: (value) => value === 'true' ? true : false }`
*/
filters?: FilterSettings;
/**
* @deprecated Use service `events` option when registering the service with `app.use`.
*/
events?: string[];
/**
* @deprecated renamed to `operators`.
*/
whitelist?: string[];
}

export interface AdapterQuery extends Query {
$limit?: number;
$skip?: number;
$select?: string[];
$sort?: { [key: string]: 1 | -1 };
}
/**
* Additional `params` that can be passed to an adapter service method call.
*/
export interface AdapterParams<
Q = AdapterQuery,
A extends Partial<AdapterServiceOptions> = Partial<AdapterServiceOptions>
> extends Params<Q> {
adapter?: A;
paginate?: PaginationParams;
}

/**
* Hook-less (internal) service methods. Directly call database adapter service methods
* without running any service-level hooks or sanitization. This can be useful if you need the raw data
* from the service and don't want to trigger any of its hooks.
*
* Important: These methods are only available internally on the server, not on the client
* side and only for the Feathers database adapters.
*
* These methods do not trigger events.
*
* @see {@link https://docs.feathersjs.com/guides/migrating.html#hook-less-service-methods}
*/
export interface InternalServiceMethods<
T = any,
D = Partial<T>,
P extends AdapterParams = AdapterParams
> {
/**
* Retrieve all resources from this service.
* Does not sanitize the query and should only be used on the server.
*
* @param _params - Service call parameters {@link Params}
*/
$find(_params?: P & { paginate?: PaginationOptions }): Promise<Paginated<T>>;
$find(_params?: P & { paginate: false }): Promise<T[]>;
$find(params?: P): Promise<T[] | Paginated<T>>;

/**
* Retrieve a single resource matching the given ID, skipping any service-level hooks.
* Does not sanitize the query and should only be used on the server.
*
* @param id - ID of the resource to locate
* @param params - Service call parameters {@link Params}
* @see {@link HookLessServiceMethods}
* @see {@link https://docs.feathersjs.com/api/services.html#get-id-params|Feathers API Documentation: .get(id, params)}
*/
$get(id: Id, params?: P): Promise<T>;

/**
* Create a new resource for this service, skipping any service-level hooks.
* Does not sanitize data or checks if multiple updates are allowed and should only be used on the server.
*
* @param data - Data to insert into this service.
* @param params - Service call parameters {@link Params}
* @see {@link HookLessServiceMethods}
* @see {@link https://docs.feathersjs.com/api/services.html#create-data-params|Feathers API Documentation: .create(data, params)}
*/
$create(data: Partial<D>, params?: P): Promise<T>;
$create(data: Partial<D>[], params?: P): Promise<T[]>;
$create(data: Partial<D> | Partial<D>[], params?: P): Promise<T | T[]>;

/**
* Completely replace the resource identified by id, skipping any service-level hooks.
* Does not sanitize data or query and should only be used on the server.
*
* @param id - ID of the resource to be updated
* @param data - Data to be put in place of the current resource.
* @param params - Service call parameters {@link Params}
* @see {@link HookLessServiceMethods}
* @see {@link https://docs.feathersjs.com/api/services.html#update-id-data-params|Feathers API Documentation: .update(id, data, params)}
*/
$update(id: Id, data: D, params?: P): Promise<T>;

/**
* Merge any resources matching the given ID with the given data, skipping any service-level hooks.
* Does not sanitize the data or query and should only be used on the server.
*
* @param id - ID of the resource to be patched
* @param data - Data to merge with the current resource.
* @param params - Service call parameters {@link Params}
* @see {@link HookLessServiceMethods}
* @see {@link https://docs.feathersjs.com/api/services.html#patch-id-data-params|Feathers API Documentation: .patch(id, data, params)}
*/
$patch(id: null, data: Partial<D>, params?: P): Promise<T[]>;
$patch(id: Id, data: Partial<D>, params?: P): Promise<T>;
$patch(id: NullableId, data: Partial<D>, params?: P): Promise<T | T[]>;

/**
* Remove resources matching the given ID from the this service, skipping any service-level hooks.
* Does not sanitize query and should only be used on the server.
*
* @param id - ID of the resource to be removed
* @param params - Service call parameters {@link Params}
* @see {@link HookLessServiceMethods}
* @see {@link https://docs.feathersjs.com/api/services.html#remove-id-params|Feathers API Documentation: .remove(id, params)}
*/
$remove(id: null, params?: P): Promise<T[]>;
$remove(id: Id, params?: P): Promise<T>;
$remove(id: NullableId, params?: P): Promise<T | T[]>;
}
116 changes: 0 additions & 116 deletions main/adapter-commons/src/filter-query.ts

This file was deleted.

28 changes: 12 additions & 16 deletions main/adapter-commons/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import { _ } from '../../commons/src/index.ts';
import { _ } from "../../commons/mod.ts";
import { Params } from "../../feathers/mod.ts";

export { AdapterService } from './service.ts';
export type { InternalServiceMethods, ServiceOptions, AdapterParams } from './service.ts';
export { filterQuery, FILTERS, OPERATORS } from './filter-query.ts';
export * from './sort.ts';
export * from "./declarations.ts";
export * from "./service.ts";
export { filterQuery, FILTERS, OPERATORS } from "./query.ts";
export * from "./sort.ts";

// Return a function that filters a result object or array
// and picks only the fields passed as `params.query.$select`
// and additional `otherFields`
export function select (params: any, ...otherFields: any[]) {
const fields = params && params.query && params.query.$select;
export function select(params: Params, ...otherFields: string[]) {
const queryFields: string[] | undefined = params?.query?.$select;

if (Array.isArray(fields) && otherFields.length) {
fields.push(...otherFields);
if (!queryFields) {
return (result: any) => result;
}

const convert = (result: any) => {
if (!Array.isArray(fields)) {
return result;
}

return _.pick(result, ...fields);
};
const resultFields = queryFields.concat(otherFields);
const convert = (result: any) => _.pick(result, ...resultFields);

return (result: any) => {
if (Array.isArray(result)) {
Expand Down