@conduitplatform/grpc-sdk 0.16.26 → 0.17.0-alpha.1
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/LICENSE +21 -0
- package/dist/index.cjs +18094 -14824
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3388 -0
- package/dist/index.d.ts +3308 -21
- package/dist/index.esm.js +17839 -14629
- package/dist/index.esm.js.map +1 -1
- package/dist/module.proto +25 -0
- package/package.json +32 -36
- package/dist/classes/ConduitAuthorizedResource.d.ts +0 -12
- package/dist/classes/ConduitModule.d.ts +0 -28
- package/dist/classes/ConduitSchema.d.ts +0 -10
- package/dist/classes/Error.d.ts +0 -11
- package/dist/classes/HealthCheck.d.ts +0 -1
- package/dist/classes/index.d.ts +0 -5
- package/dist/constants/enums/PlatformTypesEnum.d.ts +0 -10
- package/dist/constants/enums/index.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/interceptors/grpcSignedToken.d.ts +0 -2
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/moduleName.d.ts +0 -2
- package/dist/interfaces/ConduitMiddleware.d.ts +0 -7
- package/dist/interfaces/ConduitRoute.d.ts +0 -7
- package/dist/interfaces/ConduitRouteReturn.d.ts +0 -48
- package/dist/interfaces/ConduitSchemaExtension.d.ts +0 -5
- package/dist/interfaces/GrpcCallback.d.ts +0 -4
- package/dist/interfaces/IConduitLogger.d.ts +0 -13
- package/dist/interfaces/IConduitMetrics.d.ts +0 -16
- package/dist/interfaces/Indexable.d.ts +0 -9
- package/dist/interfaces/Model.d.ts +0 -170
- package/dist/interfaces/Params.d.ts +0 -8
- package/dist/interfaces/ProxyRoute.d.ts +0 -42
- package/dist/interfaces/RawQuery.d.ts +0 -22
- package/dist/interfaces/Route.d.ts +0 -71
- package/dist/interfaces/Socket.d.ts +0 -22
- package/dist/interfaces/UntypedArray.d.ts +0 -1
- package/dist/interfaces/index.d.ts +0 -16
- package/dist/interfaces/types.d.ts +0 -38
- package/dist/modules/admin/index.d.ts +0 -9
- package/dist/modules/authentication/index.d.ts +0 -23
- package/dist/modules/authorization/index.d.ts +0 -20
- package/dist/modules/chat/index.d.ts +0 -9
- package/dist/modules/config/index.d.ts +0 -33
- package/dist/modules/core/index.d.ts +0 -6
- package/dist/modules/database/index.d.ts +0 -64
- package/dist/modules/database/types.d.ts +0 -17
- package/dist/modules/email/index.d.ts +0 -36
- package/dist/modules/index.d.ts +0 -12
- package/dist/modules/pushNotifications/index.d.ts +0 -24
- package/dist/modules/pushNotifications/types.d.ts +0 -7
- package/dist/modules/router/index.d.ts +0 -10
- package/dist/modules/sms/index.d.ts +0 -9
- package/dist/modules/storage/index.d.ts +0 -24
- package/dist/modules/storage/types.d.ts +0 -24
- package/dist/protoUtils/authentication.d.ts +0 -665
- package/dist/protoUtils/authorization.d.ts +0 -524
- package/dist/protoUtils/chat.d.ts +0 -142
- package/dist/protoUtils/core.d.ts +0 -569
- package/dist/protoUtils/database.d.ts +0 -886
- package/dist/protoUtils/email.d.ts +0 -266
- package/dist/protoUtils/google/protobuf/empty.d.ts +0 -25
- package/dist/protoUtils/grpc_health_check.d.ts +0 -88
- package/dist/protoUtils/index.d.ts +0 -12
- package/dist/protoUtils/module.d.ts +0 -251
- package/dist/protoUtils/push-notifications.d.ts +0 -225
- package/dist/protoUtils/router.d.ts +0 -205
- package/dist/protoUtils/sms.d.ts +0 -147
- package/dist/protoUtils/storage.d.ts +0 -354
- package/dist/types/db.d.ts +0 -26
- package/dist/types/index.d.ts +0 -28
- package/dist/types/options.d.ts +0 -7
- package/dist/utilities/EventBus.d.ts +0 -12
- package/dist/utilities/RedisManager.d.ts +0 -24
- package/dist/utilities/StateManager.d.ts +0 -19
- package/dist/utilities/env.d.ts +0 -1
- package/dist/utilities/index.d.ts +0 -5
- package/dist/utilities/normalizeOptions.d.ts +0 -3
- package/dist/utilities/sleep.d.ts +0 -1
package/dist/module.proto
CHANGED
|
@@ -9,8 +9,33 @@ message SetConfigResponse {
|
|
|
9
9
|
string updatedConfig = 1;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
message GetExportableResourcesRequest {}
|
|
13
|
+
|
|
14
|
+
message GetExportableResourcesResponse {
|
|
15
|
+
string resources = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message ExportResourcesRequest {
|
|
19
|
+
repeated string resourceTypes = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ExportResourcesResponse {
|
|
23
|
+
string data = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message ImportResourcesRequest {
|
|
27
|
+
string data = 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message ImportResourcesResponse {
|
|
31
|
+
string result = 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
12
34
|
service ConduitModule {
|
|
13
35
|
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse);
|
|
36
|
+
rpc GetExportableResources(GetExportableResourcesRequest) returns (GetExportableResourcesResponse);
|
|
37
|
+
rpc ExportResources(ExportResourcesRequest) returns (ExportResourcesResponse);
|
|
38
|
+
rpc ImportResources(ImportResourcesRequest) returns (ImportResourcesResponse);
|
|
14
39
|
}
|
|
15
40
|
|
|
16
41
|
service ClientRouter {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduitplatform/grpc-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-alpha.1",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,35 +18,29 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=20"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"prepublish": "npm run build",
|
|
26
|
-
"prebuild": "npm run protoc",
|
|
27
|
-
"build": "rimraf dist && rollup -c",
|
|
28
|
-
"postbuild": "copyfiles -u 1 src/*.proto src/**/*.json ./dist/",
|
|
29
|
-
"protoc": "sh build.sh"
|
|
30
|
-
},
|
|
31
24
|
"license": "MIT",
|
|
32
25
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@grpc/
|
|
26
|
+
"@bufbuild/protobuf": "^2.10.2",
|
|
27
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
28
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
35
29
|
"@sesamecare-oss/redlock": "^1.2.0",
|
|
36
|
-
"abort-controller-x": "^0.
|
|
37
|
-
"convict": "^6.2.
|
|
38
|
-
"express": "^
|
|
39
|
-
"fast-jwt": "^6.0
|
|
40
|
-
"fs-extra": "^11.
|
|
41
|
-
"ioredis": "^5.
|
|
42
|
-
"lodash": "^4.
|
|
43
|
-
"lodash-es": "^4.
|
|
44
|
-
"nice-grpc": "^2.1.
|
|
45
|
-
"nice-grpc-client-middleware-retry": "^3",
|
|
30
|
+
"abort-controller-x": "^0.5.0",
|
|
31
|
+
"convict": "^6.2.5",
|
|
32
|
+
"express": "^5.2.1",
|
|
33
|
+
"fast-jwt": "^6.1.0",
|
|
34
|
+
"fs-extra": "^11.3.4",
|
|
35
|
+
"ioredis": "^5.10.1",
|
|
36
|
+
"lodash": "^4.18.1",
|
|
37
|
+
"lodash-es": "^4.18.1",
|
|
38
|
+
"nice-grpc": "^2.1.14",
|
|
39
|
+
"nice-grpc-client-middleware-retry": "^3.1.13",
|
|
46
40
|
"prom-client": "^15.1.3",
|
|
47
|
-
"protobufjs": "^
|
|
48
|
-
"winston": "^3.
|
|
49
|
-
"winston-loki": "^6.
|
|
41
|
+
"protobufjs": "^8.0.1",
|
|
42
|
+
"winston": "^3.19.0",
|
|
43
|
+
"winston-loki": "^6.1.4"
|
|
50
44
|
},
|
|
51
45
|
"directories": {
|
|
52
46
|
"lib": "dist",
|
|
@@ -61,26 +55,28 @@
|
|
|
61
55
|
"directory": "libraries/grpc-sdk"
|
|
62
56
|
},
|
|
63
57
|
"devDependencies": {
|
|
64
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
65
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
66
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
67
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
68
58
|
"@types/convict": "^6.1.6",
|
|
69
|
-
"@types/express": "^
|
|
59
|
+
"@types/express": "^5.0.6",
|
|
70
60
|
"@types/fs-extra": "^11.0.4",
|
|
71
61
|
"@types/google-protobuf": "^3.15.12",
|
|
72
|
-
"@types/lodash": "^4.17.
|
|
62
|
+
"@types/lodash": "^4.17.24",
|
|
73
63
|
"@types/lodash-es": "^4.17.12",
|
|
74
|
-
"@types/node": "
|
|
64
|
+
"@types/node": "24.9.1",
|
|
75
65
|
"copyfiles": "^2.4.1",
|
|
76
|
-
"rimraf": "^
|
|
77
|
-
"rollup": "^4.22.4",
|
|
66
|
+
"rimraf": "^6.1.3",
|
|
78
67
|
"ts-node": "^10.9.2",
|
|
79
|
-
"ts-proto": "^
|
|
68
|
+
"ts-proto": "^2.11.6",
|
|
80
69
|
"tslib": "^2.6.3",
|
|
81
|
-
"
|
|
70
|
+
"tsup": "^8.5.1",
|
|
71
|
+
"typescript": "~6.0.2"
|
|
82
72
|
},
|
|
83
73
|
"peerDependencies": {
|
|
84
74
|
"@grpc/grpc-js": "^1.13.3"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"prepublish": "npm run build",
|
|
78
|
+
"prebuild": "npm run protoc",
|
|
79
|
+
"build": "rimraf dist && tsup",
|
|
80
|
+
"protoc": "sh build.sh"
|
|
85
81
|
}
|
|
86
|
-
}
|
|
82
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Resource_Permission, Resource_Relation } from '../protoUtils/index.js';
|
|
2
|
-
export declare class ConduitAuthorizedResource {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly relations: Resource_Relation[];
|
|
5
|
-
readonly permissions: Resource_Permission[];
|
|
6
|
-
readonly version?: number;
|
|
7
|
-
constructor(name: string, relations: {
|
|
8
|
-
[field: string]: string | string[];
|
|
9
|
-
}, permissions: {
|
|
10
|
-
[action: string]: string | string[];
|
|
11
|
-
}, version?: number);
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { CompatServiceDefinition } from 'nice-grpc/lib/service-definitions';
|
|
2
|
-
import { Channel, Client } from 'nice-grpc';
|
|
3
|
-
import { ConduitModuleDefinition, HealthDefinition } from '../protoUtils/index.js';
|
|
4
|
-
import { EventEmitter } from 'events';
|
|
5
|
-
export declare class ConduitModule<T extends CompatServiceDefinition> {
|
|
6
|
-
readonly _clientName: string;
|
|
7
|
-
private readonly _serviceName;
|
|
8
|
-
private readonly _serviceUrl;
|
|
9
|
-
private readonly _grpcToken?;
|
|
10
|
-
protected channel?: Channel;
|
|
11
|
-
protected protoPath?: string;
|
|
12
|
-
protected type?: T;
|
|
13
|
-
protected readonly healthCheckEmitter: EventEmitter<[never]>;
|
|
14
|
-
constructor(_clientName: string, _serviceName: string, _serviceUrl: string, _grpcToken?: string | undefined);
|
|
15
|
-
private _client?;
|
|
16
|
-
get client(): Client<T> | undefined;
|
|
17
|
-
private _healthClient?;
|
|
18
|
-
get healthClient(): Client<typeof HealthDefinition> | undefined;
|
|
19
|
-
private _moduleClient?;
|
|
20
|
-
get moduleClient(): Client<typeof ConduitModuleDefinition> | undefined;
|
|
21
|
-
get active(): boolean;
|
|
22
|
-
get healthCheckWatcher(): EventEmitter<[never]>;
|
|
23
|
-
initializeClient(type: T): Client<T>;
|
|
24
|
-
openConnection(): void;
|
|
25
|
-
closeConnection(): void;
|
|
26
|
-
check(service?: string): Promise<import("../index.js").HealthCheckResponse_ServingStatus>;
|
|
27
|
-
watch(service?: string): Promise<void>;
|
|
28
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ConduitModel, ConduitSchemaOptions } from '../interfaces/index.js';
|
|
2
|
-
export declare class ConduitSchema {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly fields: ConduitModel;
|
|
5
|
-
readonly collectionName: string | '';
|
|
6
|
-
readonly modelOptions: ConduitSchemaOptions;
|
|
7
|
-
ownerModule: string;
|
|
8
|
-
parentSchema?: string;
|
|
9
|
-
constructor(name: string, fields: ConduitModel, modelOptions?: ConduitSchemaOptions, collectionName?: string);
|
|
10
|
-
}
|
package/dist/classes/Error.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare class ConduitError extends Error {
|
|
2
|
-
message: string;
|
|
3
|
-
name: string;
|
|
4
|
-
status: number;
|
|
5
|
-
constructor(name: string, status: number, message: string);
|
|
6
|
-
static unauthorized(message?: string): ConduitError;
|
|
7
|
-
static notFound(message?: string): ConduitError;
|
|
8
|
-
static forbidden(message?: string): ConduitError;
|
|
9
|
-
static userInput(message?: string): ConduitError;
|
|
10
|
-
static internalServerError(message?: string): void;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function checkModuleHealth(clientName: string, serviceUrl: string, service?: string, grpcToken?: string): Promise<any>;
|
package/dist/classes/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PlatformTypesEnum.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './enums/index.js';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CallOptions, ClientMiddlewareCall } from 'nice-grpc';
|
|
2
|
-
export declare function getGrpcSignedTokenInterceptor(grpcToken: string): <Request, Response>(call: ClientMiddlewareCall<Request, Response>, options: CallOptions) => AsyncGenerator<Awaited<Response>, void | Awaited<Response>, undefined>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CallOptions, ClientMiddlewareCall } from 'nice-grpc';
|
|
2
|
-
export declare function getModuleNameInterceptor(moduleName: string): <Request, Response>(call: ClientMiddlewareCall<Request, Response>, options: CallOptions) => AsyncGenerator<Awaited<Response>, void | Awaited<Response>, undefined>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ConduitReturn } from './Route.js';
|
|
2
|
-
/**
|
|
3
|
-
* Supports:
|
|
4
|
-
* {
|
|
5
|
-
* name: 'String',
|
|
6
|
-
* age: 'Number
|
|
7
|
-
* ....
|
|
8
|
-
* }
|
|
9
|
-
*
|
|
10
|
-
* or
|
|
11
|
-
*
|
|
12
|
-
* {
|
|
13
|
-
* name: {
|
|
14
|
-
* type: 'String',
|
|
15
|
-
* required: true
|
|
16
|
-
* },
|
|
17
|
-
* age: 'Number'
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* or
|
|
21
|
-
*
|
|
22
|
-
* {
|
|
23
|
-
* user: {
|
|
24
|
-
* username: 'String',
|
|
25
|
-
* age: {
|
|
26
|
-
* type: 'Number',
|
|
27
|
-
* required: true
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* or
|
|
33
|
-
*
|
|
34
|
-
* {
|
|
35
|
-
* user:{
|
|
36
|
-
* friends: ['String'],
|
|
37
|
-
* post: [{type: 'String', required:trues}]
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export declare class ConduitRouteReturnDefinition {
|
|
43
|
-
private readonly _name;
|
|
44
|
-
private readonly _fields;
|
|
45
|
-
constructor(name: string, fields?: ConduitReturn);
|
|
46
|
-
get name(): string;
|
|
47
|
-
get fields(): ConduitReturn;
|
|
48
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import winston, { LogCallback, Logger } from 'winston';
|
|
2
|
-
import { Indexable } from './Indexable.js';
|
|
3
|
-
export interface IConduitLogger {
|
|
4
|
-
get winston(): winston.Logger;
|
|
5
|
-
log(message: string, level?: string, cb?: LogCallback): Logger;
|
|
6
|
-
logObject(object: Indexable, message?: string, level?: string, cb?: LogCallback): Logger;
|
|
7
|
-
info(message: string, cb?: LogCallback): Logger;
|
|
8
|
-
warn(message: string, cb?: LogCallback): Logger;
|
|
9
|
-
error(message: string | Error, cb?: LogCallback): Logger;
|
|
10
|
-
http(message: string, cb?: LogCallback): Logger;
|
|
11
|
-
verbose(message: string, cb?: LogCallback): Logger;
|
|
12
|
-
addTransport(transport: winston.transport): void;
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Counter, CounterConfiguration, Gauge, GaugeConfiguration, Histogram, HistogramConfiguration, LabelValues, Metric, MetricConfiguration, Summary, SummaryConfiguration } from 'prom-client';
|
|
2
|
-
import { MetricType } from '../types/index.js';
|
|
3
|
-
export interface IConduitMetrics {
|
|
4
|
-
initializeDefaultMetrics(): void;
|
|
5
|
-
registerMetric(type: MetricType, config: MetricConfiguration<string>): void;
|
|
6
|
-
collectDefaultMetrics(): void;
|
|
7
|
-
createCounter(config: CounterConfiguration<any>): Counter<any>;
|
|
8
|
-
createSummary(config: SummaryConfiguration<any>): Summary<any>;
|
|
9
|
-
createHistogram(config: HistogramConfiguration<any>): Histogram<any>;
|
|
10
|
-
createGauge(config: GaugeConfiguration<any>): Gauge<any>;
|
|
11
|
-
getMetric(name: string): Metric<string> | undefined;
|
|
12
|
-
increment(metric: string, increment?: number, labels?: LabelValues<any>): void;
|
|
13
|
-
decrement(metric: string, decrement?: number, labels?: LabelValues<any>): void;
|
|
14
|
-
set(metric: string, value: number, labels?: LabelValues<any>): void;
|
|
15
|
-
observe(metric: string, value: number, labels?: LabelValues<any>): void;
|
|
16
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
export declare enum TYPE {
|
|
2
|
-
String = "String",
|
|
3
|
-
Number = "Number",
|
|
4
|
-
Boolean = "Boolean",
|
|
5
|
-
Date = "Date",
|
|
6
|
-
ObjectId = "ObjectId",
|
|
7
|
-
JSON = "JSON",
|
|
8
|
-
Relation = "Relation"
|
|
9
|
-
}
|
|
10
|
-
export declare enum SQLDataType {
|
|
11
|
-
VARCHAR = "VARCHAR",
|
|
12
|
-
TEXT = "TEXT",
|
|
13
|
-
CHAR = "CHAR",
|
|
14
|
-
INT = "INT",
|
|
15
|
-
BIGINT = "BIGINT",
|
|
16
|
-
FLOAT = "FLOAT",
|
|
17
|
-
DOUBLE = "DOUBLE",
|
|
18
|
-
DECIMAL = "DECIMAL",
|
|
19
|
-
TIME = "TIME",
|
|
20
|
-
DATETIME = "DATETIME",
|
|
21
|
-
TIMESTAMP = "TIMESTAMP"
|
|
22
|
-
}
|
|
23
|
-
export declare enum MongoIndexType {
|
|
24
|
-
Ascending = 1,
|
|
25
|
-
Descending = -1,
|
|
26
|
-
GeoSpatial2d = "2d",
|
|
27
|
-
GeoSpatial2dSphere = "2dsphere",
|
|
28
|
-
GeoHaystack = "geoHaystack",
|
|
29
|
-
Hashed = "hashed",
|
|
30
|
-
Text = "text"
|
|
31
|
-
}
|
|
32
|
-
export declare enum PostgresIndexType {
|
|
33
|
-
BTREE = "BTREE",
|
|
34
|
-
HASH = "HASH",
|
|
35
|
-
GIST = "GIST",
|
|
36
|
-
SPGIST = "SPGIST",
|
|
37
|
-
GIN = "GIN",
|
|
38
|
-
BRIN = "BRIN"
|
|
39
|
-
}
|
|
40
|
-
export type Array = any[];
|
|
41
|
-
type BaseConduitModelField = {
|
|
42
|
-
type?: TYPE | TYPE[] | ConduitModel | ArrayConduitModel[];
|
|
43
|
-
sqlType?: SQLDataType;
|
|
44
|
-
default?: any;
|
|
45
|
-
description?: string;
|
|
46
|
-
required?: boolean;
|
|
47
|
-
select?: boolean;
|
|
48
|
-
};
|
|
49
|
-
type UniqueAndRequiredField = {
|
|
50
|
-
unique: true;
|
|
51
|
-
required: true;
|
|
52
|
-
index?: SchemaFieldIndex;
|
|
53
|
-
};
|
|
54
|
-
type NotUniqueField = {
|
|
55
|
-
unique?: false;
|
|
56
|
-
required?: boolean;
|
|
57
|
-
index?: SchemaFieldIndex;
|
|
58
|
-
};
|
|
59
|
-
export type BasicConduitModelField = BaseConduitModelField & (UniqueAndRequiredField | NotUniqueField);
|
|
60
|
-
export type ConduitModelFieldRelation = BasicConduitModelField & {
|
|
61
|
-
type: TYPE.Relation | TYPE.Relation[];
|
|
62
|
-
model: string;
|
|
63
|
-
};
|
|
64
|
-
export type ConduitModelFieldJSON = BasicConduitModelField & {
|
|
65
|
-
type: TYPE.JSON | TYPE.JSON[];
|
|
66
|
-
};
|
|
67
|
-
export type ConduitModelFieldEnum = BasicConduitModelField & {
|
|
68
|
-
type: ExcludeJSONRelation<TYPE> | ExcludeJSONRelation<TYPE>[];
|
|
69
|
-
enum: any;
|
|
70
|
-
};
|
|
71
|
-
export type ConduitModelField = BasicConduitModelField & {
|
|
72
|
-
type?: ExcludeJSONRelation<TYPE> | ExcludeJSONRelation<TYPE>[] | ConduitModel | ArrayConduitModel[];
|
|
73
|
-
};
|
|
74
|
-
export type allowedTypes = ExcludeRelation<TYPE> | ConduitModelField | ConduitModelFieldEnum | ConduitModelFieldJSON | ConduitModelFieldRelation;
|
|
75
|
-
type embeddableArray = ExcludeRelation<TYPE> | ConduitModelField | ConduitModelFieldEnum | ConduitModelFieldJSON;
|
|
76
|
-
type ExcludeRelation<T> = T extends TYPE.Relation ? never : T;
|
|
77
|
-
type ExcludeJSON<T> = T extends TYPE.JSON ? never : T;
|
|
78
|
-
type ExcludeJSONRelation<T> = ExcludeJSON<ExcludeRelation<T>>;
|
|
79
|
-
export type ArrayConduitModel = {
|
|
80
|
-
type?: never;
|
|
81
|
-
sqlType?: never;
|
|
82
|
-
default?: never;
|
|
83
|
-
description?: never;
|
|
84
|
-
required?: never;
|
|
85
|
-
select?: never;
|
|
86
|
-
unique?: never;
|
|
87
|
-
index?: never;
|
|
88
|
-
enum?: never;
|
|
89
|
-
model?: never;
|
|
90
|
-
} & {
|
|
91
|
-
[field in string]: embeddableArray | embeddableArray[];
|
|
92
|
-
};
|
|
93
|
-
export type ConduitModel = {
|
|
94
|
-
type?: never;
|
|
95
|
-
sqlType?: never;
|
|
96
|
-
default?: never;
|
|
97
|
-
description?: never;
|
|
98
|
-
required?: never;
|
|
99
|
-
select?: never;
|
|
100
|
-
unique?: never;
|
|
101
|
-
index?: never;
|
|
102
|
-
enum?: never;
|
|
103
|
-
model?: never;
|
|
104
|
-
} & {
|
|
105
|
-
[field in string]: allowedTypes | allowedTypes[] | ConduitModel;
|
|
106
|
-
};
|
|
107
|
-
export declare const ConduitModelOptionsPermModifyType: string[];
|
|
108
|
-
export interface ConduitSchemaOptions {
|
|
109
|
-
timestamps?: boolean;
|
|
110
|
-
_id?: boolean;
|
|
111
|
-
conduit?: {
|
|
112
|
-
[field: string]: any;
|
|
113
|
-
permissions?: {
|
|
114
|
-
extendable: boolean;
|
|
115
|
-
canCreate: boolean;
|
|
116
|
-
canModify: 'Everything' | 'Nothing' | 'ExtensionOnly';
|
|
117
|
-
canDelete: boolean;
|
|
118
|
-
};
|
|
119
|
-
authorization?: {
|
|
120
|
-
enabled: boolean;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
indexes?: ModelOptionsIndexes[];
|
|
124
|
-
}
|
|
125
|
-
export interface SchemaFieldIndex {
|
|
126
|
-
type?: MongoIndexType | PostgresIndexType;
|
|
127
|
-
options?: MongoIndexOptions | PostgresIndexOptions;
|
|
128
|
-
[field: string]: any;
|
|
129
|
-
}
|
|
130
|
-
export interface ModelOptionsIndexes {
|
|
131
|
-
fields: string[];
|
|
132
|
-
types?: MongoIndexType[] | PostgresIndexType;
|
|
133
|
-
options?: MongoIndexOptions | PostgresIndexOptions;
|
|
134
|
-
[field: string]: any;
|
|
135
|
-
}
|
|
136
|
-
export interface MongoIndexOptions {
|
|
137
|
-
background?: boolean;
|
|
138
|
-
unique?: boolean;
|
|
139
|
-
name?: string;
|
|
140
|
-
partialFilterExpression?: Document;
|
|
141
|
-
sparse?: boolean;
|
|
142
|
-
expireAfterSeconds?: number;
|
|
143
|
-
storageEngine?: Document;
|
|
144
|
-
commitQuorum?: number | string;
|
|
145
|
-
version?: number;
|
|
146
|
-
weights?: Document;
|
|
147
|
-
default_language?: string;
|
|
148
|
-
language_override?: string;
|
|
149
|
-
textIndexVersion?: number;
|
|
150
|
-
'2dsphereIndexVersion'?: number;
|
|
151
|
-
bits?: number;
|
|
152
|
-
min?: number;
|
|
153
|
-
max?: number;
|
|
154
|
-
bucketSize?: number;
|
|
155
|
-
wildcardProjection?: Document;
|
|
156
|
-
hidden?: boolean;
|
|
157
|
-
}
|
|
158
|
-
export interface PostgresIndexOptions {
|
|
159
|
-
concurrently?: boolean;
|
|
160
|
-
name?: string;
|
|
161
|
-
operator?: string;
|
|
162
|
-
parser?: null | string;
|
|
163
|
-
prefix?: string;
|
|
164
|
-
unique?: boolean;
|
|
165
|
-
using?: PostgresIndexType;
|
|
166
|
-
where?: {
|
|
167
|
-
[opt: string]: any;
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export declare enum ProxyRouteActions {
|
|
2
|
-
GET = "GET",
|
|
3
|
-
POST = "POST",
|
|
4
|
-
UPDATE = "PUT",
|
|
5
|
-
PATCH = "PATCH",
|
|
6
|
-
DELETE = "DELETE",
|
|
7
|
-
ALL = "ALL"
|
|
8
|
-
}
|
|
9
|
-
export interface ProxyRouteOptions {
|
|
10
|
-
path: string;
|
|
11
|
-
action?: ProxyRouteActions;
|
|
12
|
-
description?: string;
|
|
13
|
-
middlewares?: string[];
|
|
14
|
-
}
|
|
15
|
-
export interface ProxyMiddlewareOptions {
|
|
16
|
-
target: string;
|
|
17
|
-
changeOrigin?: boolean;
|
|
18
|
-
secure?: boolean;
|
|
19
|
-
context?: string | string[];
|
|
20
|
-
pathRewrite?: {
|
|
21
|
-
[path: string]: string;
|
|
22
|
-
};
|
|
23
|
-
headers?: {
|
|
24
|
-
[name: string]: string;
|
|
25
|
-
};
|
|
26
|
-
proxyTimeout?: number;
|
|
27
|
-
cookieDomainRewrite?: {
|
|
28
|
-
[hostname: string]: string;
|
|
29
|
-
};
|
|
30
|
-
autoRewrite?: boolean;
|
|
31
|
-
followRedirects?: boolean;
|
|
32
|
-
xfwd?: boolean;
|
|
33
|
-
ws?: boolean;
|
|
34
|
-
router?: {
|
|
35
|
-
[path: string]: string;
|
|
36
|
-
};
|
|
37
|
-
preserveHeaderKeyCase?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface ConduitProxyObject {
|
|
40
|
-
options: ProxyRouteOptions;
|
|
41
|
-
proxy: ProxyMiddlewareOptions;
|
|
42
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface RawQuery {
|
|
2
|
-
mongoQuery?: RawMongoQuery;
|
|
3
|
-
sqlQuery?: RawSQLQuery;
|
|
4
|
-
}
|
|
5
|
-
export type RawMongoQuery = {
|
|
6
|
-
aggregate?: object[];
|
|
7
|
-
count?: object;
|
|
8
|
-
deleteOne?: object;
|
|
9
|
-
deleteMany?: object | object[];
|
|
10
|
-
drop?: object;
|
|
11
|
-
explain?: object;
|
|
12
|
-
find?: object;
|
|
13
|
-
insertOne?: object;
|
|
14
|
-
insertMany?: object | object[];
|
|
15
|
-
updateOne?: object | object[];
|
|
16
|
-
updateMany?: object | object[];
|
|
17
|
-
options?: object;
|
|
18
|
-
};
|
|
19
|
-
export type RawSQLQuery = {
|
|
20
|
-
query: string;
|
|
21
|
-
options?: object;
|
|
22
|
-
};
|