@loomcore/api 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/databases/models/database.interface.d.ts +7 -7
- package/dist/databases/mongo-db/commands/mongo-delete-by-id.command.d.ts +2 -2
- package/dist/databases/mongo-db/commands/mongo-full-updateby-id.command.d.ts +2 -2
- package/dist/databases/mongo-db/commands/mongo-partial-update-by-id.command.d.ts +2 -2
- package/dist/databases/mongo-db/mongo-db.database.d.ts +7 -7
- package/dist/databases/mongo-db/queries/mongo-get-by-id.query.d.ts +2 -2
- package/dist/databases/postgres/commands/postgres-create-many.command.d.ts +2 -2
- package/dist/databases/postgres/commands/postgres-create.command.d.ts +2 -2
- package/dist/databases/postgres/commands/postgres-delete-by-id.command.d.ts +2 -2
- package/dist/databases/postgres/commands/postgres-full-update-by-id.command.d.ts +2 -2
- package/dist/databases/postgres/commands/postgres-partial-update-by-id.command.d.ts +2 -2
- package/dist/databases/postgres/postgres.database.d.ts +8 -8
- package/dist/databases/postgres/queries/postgres-get-by-id.query.d.ts +2 -2
- package/dist/models/refresh-token.model.d.ts +3 -3
- package/dist/services/auth.service.d.ts +2 -2
- package/dist/services/generic-api-service/generic-api-service.interface.d.ts +6 -6
- package/dist/services/generic-api-service/generic-api.service.d.ts +6 -6
- package/dist/services/organization.service.d.ts +3 -3
- package/dist/services/user.service.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IModelSpec, IQueryOptions, IPagedResult, IEntity } from "@loomcore/common/models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
3
3
|
import { DeleteResult } from "./delete-result.js";
|
|
4
4
|
import { TSchema } from "@sinclair/typebox";
|
|
5
5
|
import { Operation } from "../operations/operation.js";
|
|
@@ -8,21 +8,21 @@ export interface IDatabase {
|
|
|
8
8
|
postProcessEntity<T extends IEntity>(entity: T, modelSpec: TSchema): T;
|
|
9
9
|
getAll<T extends IEntity>(operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
10
10
|
get<T extends IEntity>(operations: Operation[], queryOptions: IQueryOptions, modelSpec: IModelSpec, pluralResourceName: string): Promise<IPagedResult<T>>;
|
|
11
|
-
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id:
|
|
11
|
+
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id: AppIdType, pluralResourceName: string): Promise<T | null>;
|
|
12
12
|
getCount(pluralResourceName: string): Promise<number>;
|
|
13
13
|
create<T extends IEntity>(entity: Partial<T>, pluralResourceName: string): Promise<{
|
|
14
|
-
insertedId:
|
|
14
|
+
insertedId: AppIdType;
|
|
15
15
|
entity: T;
|
|
16
16
|
}>;
|
|
17
17
|
createMany<T extends IEntity>(entities: Partial<T>[], pluralResourceName: string): Promise<{
|
|
18
|
-
insertedIds:
|
|
18
|
+
insertedIds: AppIdType[];
|
|
19
19
|
entities: T[];
|
|
20
20
|
}>;
|
|
21
21
|
batchUpdate<T extends IEntity>(entities: Partial<T>[], operations: Operation[], queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
22
|
-
fullUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
23
|
-
partialUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
22
|
+
fullUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
23
|
+
partialUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
24
24
|
update<T extends IEntity>(queryObject: IQueryOptions, entity: Partial<T>, operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
25
|
-
deleteById(id:
|
|
25
|
+
deleteById(id: AppIdType, pluralResourceName: string): Promise<DeleteResult>;
|
|
26
26
|
deleteMany(queryObject: IQueryOptions, pluralResourceName: string): Promise<DeleteResult>;
|
|
27
27
|
find<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
28
28
|
findOne<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Db } from "mongodb";
|
|
2
2
|
import { DeleteResult as GenericDeleteResult } from "../../models/delete-result.js";
|
|
3
|
-
import type {
|
|
4
|
-
export declare function deleteById(db: Db, id:
|
|
3
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
4
|
+
export declare function deleteById(db: Db, id: AppIdType, pluralResourceName: string): Promise<GenericDeleteResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Db } from "mongodb";
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
|
-
import type {
|
|
4
|
-
export declare function fullUpdateById<T>(db: Db, operations: Operation[], id:
|
|
3
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
4
|
+
export declare function fullUpdateById<T>(db: Db, operations: Operation[], id: AppIdType, entity: any, pluralResourceName: string): Promise<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Db } from "mongodb";
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
|
-
import type {
|
|
4
|
-
export declare function partialUpdateById<T>(db: Db, operations: Operation[], id:
|
|
3
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
4
|
+
export declare function partialUpdateById<T>(db: Db, operations: Operation[], id: AppIdType, entity: Partial<any>, pluralResourceName: string): Promise<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Db } from "mongodb";
|
|
2
2
|
import { IModelSpec, IQueryOptions, IPagedResult, IEntity } from "@loomcore/common/models";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
4
4
|
import { Operation } from "../operations/operation.js";
|
|
5
5
|
import { DeleteResult as GenericDeleteResult } from "../models/delete-result.js";
|
|
6
6
|
import { TSchema } from "@sinclair/typebox";
|
|
@@ -12,21 +12,21 @@ export declare class MongoDBDatabase implements IDatabase {
|
|
|
12
12
|
postProcessEntity<T extends IEntity>(single: T, schema: TSchema): T;
|
|
13
13
|
getAll<T extends IEntity>(operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
14
14
|
get<T extends IEntity>(operations: Operation[], queryOptions: IQueryOptions, modelSpec: IModelSpec, pluralResourceName: string): Promise<IPagedResult<T>>;
|
|
15
|
-
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id:
|
|
15
|
+
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id: AppIdType, pluralResourceName: string): Promise<T | null>;
|
|
16
16
|
getCount(pluralResourceName: string): Promise<number>;
|
|
17
17
|
create<T extends IEntity>(entity: Partial<T>, pluralResourceName: string): Promise<{
|
|
18
|
-
insertedId:
|
|
18
|
+
insertedId: AppIdType;
|
|
19
19
|
entity: T;
|
|
20
20
|
}>;
|
|
21
21
|
createMany<T extends IEntity>(entities: Partial<T>[], pluralResourceName: string): Promise<{
|
|
22
|
-
insertedIds:
|
|
22
|
+
insertedIds: AppIdType[];
|
|
23
23
|
entities: T[];
|
|
24
24
|
}>;
|
|
25
25
|
batchUpdate<T extends IEntity>(entities: Partial<T>[], operations: Operation[], queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
26
|
-
fullUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
27
|
-
partialUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
26
|
+
fullUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
27
|
+
partialUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
28
28
|
update<T extends IEntity>(queryObject: IQueryOptions, entity: Partial<T>, operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
29
|
-
deleteById(id:
|
|
29
|
+
deleteById(id: AppIdType, pluralResourceName: string): Promise<GenericDeleteResult>;
|
|
30
30
|
deleteMany(queryObject: IQueryOptions, pluralResourceName: string): Promise<GenericDeleteResult>;
|
|
31
31
|
find<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
32
32
|
findOne<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Db } from "mongodb";
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
3
|
import { IQueryOptions } from "@loomcore/common/models";
|
|
4
|
-
import type {
|
|
5
|
-
export declare function getById<T>(db: Db, operations: Operation[], queryObject: IQueryOptions, id:
|
|
4
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
5
|
+
export declare function getById<T>(db: Db, operations: Operation[], queryObject: IQueryOptions, id: AppIdType, pluralResourceName: string): Promise<T | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { IEntity } from '@loomcore/common/models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
4
4
|
export declare function createMany<T extends IEntity>(client: Client, pluralResourceName: string, entities: Partial<T>[]): Promise<{
|
|
5
|
-
insertedIds:
|
|
5
|
+
insertedIds: AppIdType[];
|
|
6
6
|
entities: T[];
|
|
7
7
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { IEntity } from "@loomcore/common/models";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
4
4
|
export declare function create<T extends IEntity>(client: Client, pluralResourceName: string, entity: Partial<T>): Promise<{
|
|
5
|
-
insertedId:
|
|
5
|
+
insertedId: AppIdType;
|
|
6
6
|
entity: T;
|
|
7
7
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { DeleteResult } from "../../models/delete-result.js";
|
|
3
|
-
import type {
|
|
4
|
-
export declare function deleteById(client: Client, id:
|
|
3
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
4
|
+
export declare function deleteById(client: Client, id: AppIdType, pluralResourceName: string): Promise<DeleteResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
3
|
import { IEntity } from '@loomcore/common/models';
|
|
4
|
-
import type {
|
|
5
|
-
export declare function fullUpdateById<T extends IEntity>(client: Client, operations: Operation[], id:
|
|
4
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
5
|
+
export declare function fullUpdateById<T extends IEntity>(client: Client, operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
3
|
import { IEntity } from '@loomcore/common/models';
|
|
4
|
-
import type {
|
|
5
|
-
export declare function partialUpdateById<T extends IEntity>(client: Client, operations: Operation[], id:
|
|
4
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
5
|
+
export declare function partialUpdateById<T extends IEntity>(client: Client, operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IQueryOptions, IModelSpec, IPagedResult, IEntity, IUserContextAuthorization } from "@loomcore/common/models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
3
3
|
import { TSchema } from "@sinclair/typebox";
|
|
4
4
|
import { DeleteResult, IDatabase } from "../models/index.js";
|
|
5
5
|
import { Operation } from "../operations/operation.js";
|
|
@@ -11,23 +11,23 @@ export declare class PostgresDatabase implements IDatabase {
|
|
|
11
11
|
postProcessEntity<T extends IEntity>(entity: T, modelSpec: TSchema): T;
|
|
12
12
|
getAll<T extends IEntity>(operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
13
13
|
get<T extends IEntity>(operations: Operation[], queryOptions: IQueryOptions, modelSpec: IModelSpec, pluralResourceName: string): Promise<IPagedResult<T>>;
|
|
14
|
-
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id:
|
|
14
|
+
getById<T extends IEntity>(operations: Operation[], queryObject: IQueryOptions, id: AppIdType, pluralResourceName: string): Promise<T | null>;
|
|
15
15
|
getCount(pluralResourceName: string): Promise<number>;
|
|
16
16
|
create<T extends IEntity>(entity: Partial<T>, pluralResourceName: string): Promise<{
|
|
17
|
-
insertedId:
|
|
17
|
+
insertedId: AppIdType;
|
|
18
18
|
entity: T;
|
|
19
19
|
}>;
|
|
20
20
|
createMany<T extends IEntity>(entities: Partial<T>[], pluralResourceName: string): Promise<{
|
|
21
|
-
insertedIds:
|
|
21
|
+
insertedIds: AppIdType[];
|
|
22
22
|
entities: T[];
|
|
23
23
|
}>;
|
|
24
24
|
batchUpdate<T extends IEntity>(entities: Partial<T>[], operations: Operation[], queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
25
|
-
fullUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
26
|
-
partialUpdateById<T extends IEntity>(operations: Operation[], id:
|
|
25
|
+
fullUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
26
|
+
partialUpdateById<T extends IEntity>(operations: Operation[], id: AppIdType, entity: Partial<T>, pluralResourceName: string): Promise<T>;
|
|
27
27
|
update<T extends IEntity>(queryObject: IQueryOptions, entity: Partial<T>, operations: Operation[], pluralResourceName: string): Promise<T[]>;
|
|
28
|
-
deleteById(id:
|
|
28
|
+
deleteById(id: AppIdType, pluralResourceName: string): Promise<DeleteResult>;
|
|
29
29
|
deleteMany(queryObject: IQueryOptions, pluralResourceName: string): Promise<DeleteResult>;
|
|
30
30
|
find<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T[]>;
|
|
31
31
|
findOne<T extends IEntity>(queryObject: IQueryOptions, pluralResourceName: string): Promise<T | null>;
|
|
32
|
-
getUserAuthorizations(userId:
|
|
32
|
+
getUserAuthorizations(userId: AppIdType, orgId?: AppIdType): Promise<IUserContextAuthorization[]>;
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'pg';
|
|
2
2
|
import { Operation } from "../../operations/operation.js";
|
|
3
3
|
import { IQueryOptions } from '@loomcore/common/models';
|
|
4
|
-
import type {
|
|
5
|
-
export declare function getById<T>(client: Client, operations: Operation[], queryObject: IQueryOptions, id:
|
|
4
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
5
|
+
export declare function getById<T>(client: Client, operations: Operation[], queryObject: IQueryOptions, id: AppIdType, pluralResourceName: string): Promise<T | null>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IEntity } from "@loomcore/common/models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppIdType } from "@loomcore/common/types";
|
|
3
3
|
export interface IRefreshToken extends IEntity {
|
|
4
4
|
token: string;
|
|
5
5
|
deviceId: string;
|
|
6
|
-
userId:
|
|
6
|
+
userId: AppIdType;
|
|
7
7
|
expiresOn: number;
|
|
8
8
|
created: Date;
|
|
9
|
-
createdBy:
|
|
9
|
+
createdBy: AppIdType;
|
|
10
10
|
}
|
|
11
11
|
export declare const refreshTokenSchema: import("@sinclair/typebox").TObject<{
|
|
12
12
|
token: import("@sinclair/typebox").TString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
2
|
import { IUserContext, ITokenResponse, ILoginResponse, IUser } from '@loomcore/common/models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
4
4
|
import { MultiTenantApiService } from './multi-tenant-api.service.js';
|
|
5
5
|
import { UpdateResult } from '../databases/models/update-result.js';
|
|
6
6
|
import { IRefreshToken } from '../models/refresh-token.model.js';
|
|
@@ -31,7 +31,7 @@ export declare class AuthService extends MultiTenantApiService<IUser> {
|
|
|
31
31
|
expiresOn: number;
|
|
32
32
|
}>;
|
|
33
33
|
getActiveRefreshToken(refreshToken: string, deviceId: string): Promise<IRefreshToken | null>;
|
|
34
|
-
createNewRefreshToken(userId:
|
|
34
|
+
createNewRefreshToken(userId: AppIdType, deviceId: string, orgId?: AppIdType): Promise<IRefreshToken | null>;
|
|
35
35
|
sendResetPasswordEmail(emailAddress: string): Promise<void>;
|
|
36
36
|
resetPassword(email: string, passwordResetToken: string, password: string): Promise<UpdateResult>;
|
|
37
37
|
deleteRefreshTokensForDevice(deviceId: string): Promise<import("../databases/models/delete-result.js").DeleteResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValueError } from '@sinclair/typebox/errors';
|
|
2
2
|
import { IUserContext, IEntity, IPagedResult, IQueryOptions } from '@loomcore/common/models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
4
4
|
import { DeleteResult } from '../../databases/models/delete-result.js';
|
|
5
5
|
import { Operation } from '../../databases/operations/operation.js';
|
|
6
6
|
export interface IGenericApiService<T extends IEntity> {
|
|
@@ -14,16 +14,16 @@ export interface IGenericApiService<T extends IEntity> {
|
|
|
14
14
|
postProcessEntity(userContext: IUserContext, entity: T): T;
|
|
15
15
|
getAll(userContext: IUserContext): Promise<T[]>;
|
|
16
16
|
get(userContext: IUserContext, queryOptions: IQueryOptions): Promise<IPagedResult<T>>;
|
|
17
|
-
getById(userContext: IUserContext, id:
|
|
17
|
+
getById(userContext: IUserContext, id: AppIdType): Promise<T>;
|
|
18
18
|
getCount(userContext: IUserContext): Promise<number>;
|
|
19
19
|
create(userContext: IUserContext, entity: Partial<T>): Promise<T | null>;
|
|
20
20
|
createMany(userContext: IUserContext, entities: Partial<T>[]): Promise<T[]>;
|
|
21
21
|
batchUpdate(userContext: IUserContext, entities: Partial<T>[]): Promise<T[]>;
|
|
22
|
-
fullUpdateById(userContext: IUserContext, id:
|
|
23
|
-
partialUpdateById(userContext: IUserContext, id:
|
|
24
|
-
partialUpdateByIdWithoutPreAndPostProcessing(userContext: IUserContext, id:
|
|
22
|
+
fullUpdateById(userContext: IUserContext, id: AppIdType, entity: T): Promise<T>;
|
|
23
|
+
partialUpdateById(userContext: IUserContext, id: AppIdType, entity: Partial<T>): Promise<T>;
|
|
24
|
+
partialUpdateByIdWithoutPreAndPostProcessing(userContext: IUserContext, id: AppIdType, entity: T): Promise<T>;
|
|
25
25
|
update(userContext: IUserContext, queryObject: IQueryOptions, entity: Partial<T>): Promise<T[]>;
|
|
26
|
-
deleteById(userContext: IUserContext, id:
|
|
26
|
+
deleteById(userContext: IUserContext, id: AppIdType): Promise<DeleteResult>;
|
|
27
27
|
deleteMany(userContext: IUserContext, queryObject: IQueryOptions): Promise<DeleteResult>;
|
|
28
28
|
find(userContext: IUserContext, queryObject: IQueryOptions, options?: any): Promise<T[]>;
|
|
29
29
|
findOne(userContext: IUserContext, queryObject: IQueryOptions, options?: any): Promise<T | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValueError } from '@sinclair/typebox/errors';
|
|
2
2
|
import { IUserContext, IEntity, IQueryOptions, IPagedResult, IModelSpec } from '@loomcore/common/models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
4
4
|
import { IGenericApiService } from './generic-api-service.interface.js';
|
|
5
5
|
import { Operation } from '../../databases/operations/operation.js';
|
|
6
6
|
import { DeleteResult } from '../../databases/models/delete-result.js';
|
|
@@ -22,16 +22,16 @@ export declare class GenericApiService<T extends IEntity> implements IGenericApi
|
|
|
22
22
|
postProcessEntity(userContext: IUserContext, entity: T): T;
|
|
23
23
|
get(userContext: IUserContext, queryOptions?: IQueryOptions): Promise<IPagedResult<T>>;
|
|
24
24
|
protected prepareQueryOptions(userContext: IUserContext | undefined, queryOptions: IQueryOptions): IQueryOptions;
|
|
25
|
-
getById(userContext: IUserContext, id:
|
|
25
|
+
getById(userContext: IUserContext, id: AppIdType): Promise<T>;
|
|
26
26
|
getCount(userContext: IUserContext): Promise<number>;
|
|
27
27
|
create(userContext: IUserContext, entity: Partial<T>): Promise<T | null>;
|
|
28
28
|
createMany(userContext: IUserContext, entities: Partial<T>[]): Promise<T[]>;
|
|
29
29
|
batchUpdate(userContext: IUserContext, entities: Partial<T>[]): Promise<T[]>;
|
|
30
|
-
fullUpdateById(userContext: IUserContext, id:
|
|
31
|
-
partialUpdateById(userContext: IUserContext, id:
|
|
32
|
-
partialUpdateByIdWithoutPreAndPostProcessing(userContext: IUserContext, id:
|
|
30
|
+
fullUpdateById(userContext: IUserContext, id: AppIdType, entity: T): Promise<T>;
|
|
31
|
+
partialUpdateById(userContext: IUserContext, id: AppIdType, entity: Partial<T>): Promise<T>;
|
|
32
|
+
partialUpdateByIdWithoutPreAndPostProcessing(userContext: IUserContext, id: AppIdType, entity: Partial<T>): Promise<T>;
|
|
33
33
|
update(userContext: IUserContext, queryObject: IQueryOptions, entity: Partial<T>): Promise<T[]>;
|
|
34
|
-
deleteById(userContext: IUserContext, id:
|
|
34
|
+
deleteById(userContext: IUserContext, id: AppIdType): Promise<DeleteResult>;
|
|
35
35
|
deleteMany(userContext: IUserContext, queryObject: IQueryOptions): Promise<DeleteResult>;
|
|
36
36
|
find(userContext: IUserContext, queryObject: IQueryOptions): Promise<T[]>;
|
|
37
37
|
findOne(userContext: IUserContext, queryObject: IQueryOptions): Promise<T | null>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IOrganization, IUserContext } from '@loomcore/common/models';
|
|
2
2
|
import { IDatabase } from '../databases/models/database.interface.js';
|
|
3
3
|
import { GenericApiService } from './generic-api-service/generic-api.service.js';
|
|
4
|
-
import {
|
|
4
|
+
import { AppIdType } from '@loomcore/common/types';
|
|
5
5
|
export declare class OrganizationService extends GenericApiService<IOrganization> {
|
|
6
6
|
constructor(database: IDatabase);
|
|
7
7
|
preProcessEntity(userContext: IUserContext, entity: Partial<IOrganization>, isCreate: boolean, allowId?: boolean): Promise<Partial<IOrganization>>;
|
|
8
|
-
getAuthTokenByRepoCode(userContext: IUserContext, orgId:
|
|
9
|
-
validateRepoAuthToken(userContext: IUserContext, orgCode: string, authToken: string): Promise<
|
|
8
|
+
getAuthTokenByRepoCode(userContext: IUserContext, orgId: AppIdType): Promise<string | null>;
|
|
9
|
+
validateRepoAuthToken(userContext: IUserContext, orgCode: string, authToken: string): Promise<AppIdType | null>;
|
|
10
10
|
getMetaOrg(userContext: IUserContext): Promise<IOrganization | null>;
|
|
11
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IUser, IUserContext } from '@loomcore/common/models';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppIdType } from '@loomcore/common/types';
|
|
3
3
|
import { MultiTenantApiService } from './index.js';
|
|
4
4
|
import { IDatabase } from '../databases/models/index.js';
|
|
5
5
|
export declare class UserService extends MultiTenantApiService<IUser> {
|
|
6
6
|
constructor(database: IDatabase);
|
|
7
|
-
fullUpdateById(userContext: IUserContext, id:
|
|
7
|
+
fullUpdateById(userContext: IUserContext, id: AppIdType, entity: IUser): Promise<IUser>;
|
|
8
8
|
preProcessEntity(userContext: IUserContext, entity: Partial<IUser>, isCreate: boolean, allowId?: boolean): Promise<Partial<IUser>>;
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcore/api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
|
|
6
6
|
"scripts": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"qs": "^6.14.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@loomcore/common": "^0.0.
|
|
56
|
+
"@loomcore/common": "^0.0.43",
|
|
57
57
|
"@sinclair/typebox": "0.34.33",
|
|
58
58
|
"cookie-parser": "^1.4.6",
|
|
59
59
|
"cors": "^2.8.5",
|