@pgds/api-interface 1.2.5

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.
Files changed (65) hide show
  1. package/README.md +410 -0
  2. package/client/FairtrailClient.d.ts +38 -0
  3. package/client/FairtrailClient.js +219 -0
  4. package/client/FairtrailClient.js.map +1 -0
  5. package/client/HttpClient.d.ts +36 -0
  6. package/client/HttpClient.js +360 -0
  7. package/client/HttpClient.js.map +1 -0
  8. package/client/index.d.ts +3 -0
  9. package/client/index.js +8 -0
  10. package/client/index.js.map +1 -0
  11. package/constants/index.d.ts +8 -0
  12. package/constants/index.js +13 -0
  13. package/constants/index.js.map +1 -0
  14. package/errors/index.d.ts +1 -0
  15. package/errors/index.js +72 -0
  16. package/errors/index.js.map +1 -0
  17. package/index.d.ts +7 -0
  18. package/index.js +23 -0
  19. package/lib/auth/mustbeConfig.d.ts +13 -0
  20. package/lib/auth/mustbeConfig.js +167 -0
  21. package/lib/auth/mustbeConfig.js.map +1 -0
  22. package/lib/constants/constants.d.ts +3 -0
  23. package/lib/constants/constants.js +8 -0
  24. package/lib/constants/constants.js.map +1 -0
  25. package/lib/index.d.ts +255 -0
  26. package/lib/index.js +462 -0
  27. package/lib/index.js.map +1 -0
  28. package/lib/models/Http.d.ts +62 -0
  29. package/lib/models/Http.js +3 -0
  30. package/lib/models/Http.js.map +1 -0
  31. package/lib/models/ReqUser.d.ts +10 -0
  32. package/lib/models/ReqUser.js +3 -0
  33. package/lib/models/ReqUser.js.map +1 -0
  34. package/lib/server/server.d.ts +13 -0
  35. package/lib/server/server.js +154 -0
  36. package/lib/server/server.js.map +1 -0
  37. package/lib/utils/asyncHooks.d.ts +28 -0
  38. package/lib/utils/asyncHooks.js +99 -0
  39. package/lib/utils/asyncHooks.js.map +1 -0
  40. package/lib/utils/jsonSchemaUtils.d.ts +14 -0
  41. package/lib/utils/jsonSchemaUtils.js +187 -0
  42. package/lib/utils/jsonSchemaUtils.js.map +1 -0
  43. package/lib/utils/logger.d.ts +5 -0
  44. package/lib/utils/logger.js +33 -0
  45. package/lib/utils/logger.js.map +1 -0
  46. package/lib/utils/urlUtils.d.ts +1 -0
  47. package/lib/utils/urlUtils.js +14 -0
  48. package/lib/utils/urlUtils.js.map +1 -0
  49. package/package.json +104 -0
  50. package/types/hiot.d.ts +368 -0
  51. package/types/mustbe/config/activities.d.ts +11 -0
  52. package/types/mustbe/config/index.d.ts +77 -0
  53. package/types/mustbe/config/parameter-map.d.ts +8 -0
  54. package/types/mustbe/config/route-helpers.d.ts +17 -0
  55. package/types/mustbe/config/user-identity.d.ts +7 -0
  56. package/types/mustbe/core.d.ts +23 -0
  57. package/types/mustbe/identities/userIdentity.d.ts +10 -0
  58. package/types/mustbe/index.d.ts +6 -0
  59. package/types/mustbe/principals/index.d.ts +10 -0
  60. package/types/mustbe/registry.d.ts +11 -0
  61. package/types/mustbe/routeHelpers/index.d.ts +20 -0
  62. package/types/mustbe/verifier/index.d.ts +10 -0
  63. package/utils/index.d.ts +13 -0
  64. package/utils/index.js +32 -0
  65. package/utils/index.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "@pgds/api-interface",
3
+ "description": "Api interface for pgds services",
4
+ "authors": "Florry",
5
+ "version": "1.2.5",
6
+ "main": "index.js",
7
+ "types": "types/",
8
+ "scripts": {
9
+ "prepublish": "npm run build",
10
+ "build": "tsc",
11
+ "pretest": "npm run build",
12
+ "test": "nyc --require ts-node/register --reporter=html mocha --colors",
13
+ "clean": "git clean -f -x -e node_modules/ -e coverage/"
14
+ },
15
+ "files": [
16
+ "**/*.d.ts",
17
+ "./index.js",
18
+ "lib/**/*.js",
19
+ "lib/**/*.js.map",
20
+ "lib/**/*.d.ts",
21
+ "errors/**/*.js",
22
+ "errors/**/*.js.map",
23
+ "errors/**/*.d.ts",
24
+ "constants/**/*.js",
25
+ "constants/**/*.js.map",
26
+ "constants/**/*.d.ts",
27
+ "utils/**/*.js",
28
+ "utils/**/*.js.map",
29
+ "utils/**/*.d.ts",
30
+ "client/**/*.js",
31
+ "client/**/*.js.map",
32
+ "client/**/*.d.ts"
33
+ ],
34
+ "dependencies": {
35
+ "@types/restify": "^8.5.12",
36
+ "@types/restify-errors": "^4.3.9",
37
+ "@types/mongodb": "4.0.0",
38
+ "ajv": "8.17.1",
39
+ "ajv-formats": "3.0.1",
40
+ "axios": "1.7.9",
41
+ "bunyan": "1.8.15",
42
+ "bunyan-format": "^0.2.1",
43
+ "mustbe": "0.4.0",
44
+ "nyc": "^17.1.0",
45
+ "prom-client": "^12.0.0",
46
+ "restify": "^11.1.0",
47
+ "restify-errors": "8.0.2",
48
+ "semver": "^7.3.8",
49
+ "ts-node": "^10.9.2",
50
+ "ts-node-test-register": "^10.0.0",
51
+ "uuid": "9.0.1",
52
+ "typescript": "^5.7.2",
53
+ "typescript-json-schema": "0.65.1"
54
+ },
55
+ "devDependencies": {
56
+ "@types/bunyan-format": "0.2.9",
57
+ "@types/chai": "4.3.12",
58
+ "@types/mocha": "^10.0.6",
59
+ "@types/mockery": "^1.4.30",
60
+ "@types/nock": "11.1.0",
61
+ "@types/semver": "^7.3.13",
62
+ "@types/supertest": "^2.0.11",
63
+ "@types/uuid": "^8.3.4",
64
+ "chai": "^4.3.6",
65
+ "chai-subset": "^1.6.0",
66
+ "mocha": "10.2.0",
67
+ "mockery": "2.1.0",
68
+ "supertest": "6.3.4",
69
+ "nock": "13.5.5"
70
+ },
71
+ "directories": {
72
+ "example": "examples",
73
+ "lib": "lib",
74
+ "types": "types"
75
+ },
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "git+https://github.com/hiotlabs/hiot-api-interface.git"
79
+ },
80
+ "keywords": [
81
+ "restify"
82
+ ],
83
+ "author": "",
84
+ "license": "ISC",
85
+ "bugs": {
86
+ "url": "https://github.com/hiotlabs/hiot-api-interface/issues"
87
+ },
88
+ "homepage": "https://github.com/hiotlabs/hiot-api-interface#readme",
89
+ "mocha": {
90
+ "extension": [
91
+ "ts",
92
+ "js"
93
+ ],
94
+ "spec": "test/**/*.test.{ts,js}"
95
+ },
96
+ "nyc": {
97
+ "exclude": [
98
+ "coverage",
99
+ "test",
100
+ "**/*.d.ts",
101
+ "**/*.js.map"
102
+ ]
103
+ }
104
+ }
@@ -0,0 +1,368 @@
1
+ declare module "hiot" {
2
+ import { KafkaBroker } from "hiot-kafka-broker";
3
+ import { Db } from "mongodb";
4
+ import { Server } from "restify";
5
+
6
+ export class Locator {
7
+ db: Db;
8
+ broker: KafkaBroker;
9
+ api: Server;
10
+
11
+ private constructor();
12
+ }
13
+ }
14
+
15
+ declare module "hiot-app" {
16
+ import * as Logger from "bunyan";
17
+ import { KafkaBuilder } from "hiot-kafka";
18
+ import { MongoDbBuilder } from "hiot-mongodb";
19
+ import { Locator } from "hiot";
20
+
21
+ export let mongodb: () => MongoDbBuilder;
22
+ export let kafka: () => KafkaBuilder;
23
+ export let redis: () => any;
24
+ export let connectToAdditionalDb: (locatorKey: string) => any;
25
+
26
+ type WaitForConnectionOptions = {
27
+ host?: string;
28
+ server?: string;
29
+ port: number | string;
30
+ [x: string]: any;
31
+ };
32
+
33
+ function waitFor(): WaitForBuilder;
34
+
35
+ export class WaitForBuilder {
36
+ options: {
37
+ connections: any[];
38
+ };
39
+ connection(options: WaitForConnectionOptions): WaitForBuilder;
40
+ build(): (locator: Locator) => any;
41
+
42
+ private constructor();
43
+ }
44
+
45
+ function shutdown(): ShutdownBuilder;
46
+
47
+ export class ShutdownBuilder {
48
+ options: {
49
+ close: () => any;
50
+ logger: {
51
+ error: (...data: any[]) => void;
52
+ };
53
+ };
54
+ close(close: Function): ShutdownBuilder;
55
+ logger(logger: Logger): ShutdownBuilder;
56
+ build(): (locator: Locator) => Locator;
57
+
58
+ private constructor();
59
+ }
60
+
61
+ type StartAppOptions = {
62
+ logger: Logger;
63
+ onUncaughtException: Function;
64
+ handleException: Function;
65
+ dependencies?: ("mongodb" | "kafka" | "redis")[];
66
+ aliveFilePeriod?: number;
67
+ };
68
+
69
+ function startApp(options: StartAppOptions): Promise<Locator>;
70
+
71
+ function failed(logger: Logger): (reason: string) => void;
72
+ }
73
+
74
+ declare module "hiot-app/debug" {
75
+ import { Locator } from "hiot";
76
+
77
+ function debug(): (...args: any[]) => any;
78
+
79
+ export = debug;
80
+ }
81
+
82
+ declare module "hiot-app/health" {
83
+ import { Locator } from "hiot-app/locator";
84
+ import restify from "restify";
85
+
86
+ type DefineRoutesOptions = {
87
+ prefix: string;
88
+ readiness?: { dependencies: ("mongodb" | "kafka" | "redis")[] };
89
+ liveness?: { dependencies: ("mongodb" | "kafka" | "redis")[] };
90
+ };
91
+
92
+ type RestifyHandlers = {
93
+ defineRoutes: (api: restify.Server, locator: Locator, options: DefineRoutesOptions) => void;
94
+ };
95
+
96
+ export const restifyHandlers: RestifyHandlers;
97
+ }
98
+
99
+ declare module "hiot-kafka-broker" {
100
+ import * as Logger from "bunyan";
101
+
102
+ export type ConnectionOptions = {
103
+ logger: Logger;
104
+ createTopics: boolean;
105
+ clientId: string;
106
+ connectionString: string;
107
+ groupId: string;
108
+ startingOffset: number;
109
+ };
110
+
111
+ export type Envelope<
112
+ T = {
113
+ value: {
114
+ timestamp: number;
115
+ correlationId: string;
116
+ [x: string]: any;
117
+ };
118
+ key?: string;
119
+ }
120
+ > = {
121
+ /** Exists if the message was received from Kafka, should not be set when sending a message */
122
+ ack?: (...args) => void;
123
+ /** Exists if the message was received from Kafka, should not be set when sending a message */
124
+ reject?: (...args) => void;
125
+ topic: string;
126
+ partition: number;
127
+ message: T;
128
+ };
129
+
130
+ export class KafkaBroker {
131
+ handlers: { [topic: string]: Function };
132
+ connected: boolean;
133
+ producer: {
134
+ clientId: string;
135
+ connectionString: string;
136
+ logger: {
137
+ logLevel: 4;
138
+ logFunction: (...args: any[]) => void;
139
+ };
140
+ retries: {
141
+ attempts: 3;
142
+ delay: 200;
143
+ };
144
+ };
145
+
146
+ private constructor();
147
+
148
+ connect(options: ConnectionOptions): Promise<any>;
149
+
150
+ send(envelope: Envelope): Promise<void>;
151
+
152
+ sendBatch(envelopes: Envelope[]): Promise<void>;
153
+
154
+ consume(topic: string, handler: (...args: any[]) => any): Promise<void>;
155
+
156
+ close(): void;
157
+
158
+ refresh(): void;
159
+ }
160
+ }
161
+
162
+ declare module "hiot-kafka" {
163
+ import { KafkaBroker, Envelope } from "hiot-kafka-broker";
164
+ import * as Logger from "bunyan";
165
+ import { Locator } from "hiot-app/locator";
166
+
167
+ export = () => new KafkaBuilder();
168
+
169
+ export const broker: KafkaBroker;
170
+
171
+ export const createTopics: (client: any, topics: any) => any;
172
+
173
+ export const envelope: { parse: (consumer: any, payload: any, topic: any, partition: any, logger: Logger) => any };
174
+
175
+ export const logParser: (logger: Logger) => (...args: any[]) => void;
176
+
177
+ export class KafkaBuilder {
178
+ options: {
179
+ server: string;
180
+ port: number;
181
+ groupId: string;
182
+ clientId: string;
183
+ createTopics: boolean;
184
+ logger: {
185
+ error: (...data: any[]) => void;
186
+ debug: (...data: any[]) => void;
187
+ info: (...data: any[]) => void;
188
+ trace: (...data: any[]) => void;
189
+ warn: (...data: any[]) => void;
190
+ };
191
+ handlers: () => void;
192
+ };
193
+ logger(logger: Logger): KafkaBuilder;
194
+ handlers(handlers: string[] | (() => any)): KafkaBuilder;
195
+ config(config: {
196
+ logger?: any;
197
+ connectionString?: string;
198
+ server?: string;
199
+ port?: number | string;
200
+ groupId?: string;
201
+ clientId?: string;
202
+ }): KafkaBuilder;
203
+ build(): (locator: Locator) => Locator;
204
+
205
+ private constructor();
206
+ }
207
+ }
208
+
209
+ declare module "hiot-kafka/handleEnvelope" {
210
+ function handleEnvelope<T = any>(
211
+ callback: (envelope: Envelope, options: T) => any,
212
+ options: T,
213
+ logger: Logger,
214
+ handleError: (
215
+ err: any,
216
+ data: {
217
+ extra: {
218
+ envelope: Envelope;
219
+ };
220
+ }
221
+ ) => {}
222
+ ): Promise<void>;
223
+
224
+ export = handleEnvelope;
225
+ }
226
+
227
+ declare module "hiot-app/locator" {
228
+ import { KafkaBroker } from "hiot-kafka-broker";
229
+ import { Db } from "mongodb";
230
+
231
+ const db: Db;
232
+ const broker: KafkaBroker;
233
+ const api: any;
234
+
235
+ export = { db, broker, api };
236
+ }
237
+
238
+ declare module "hiot-mongodb" {
239
+ import { ClassLikeDeclaration } from "typescript";
240
+ import { ReqUser } from "../lib/models/ReqUser";
241
+ import { Collection, Db } from "mongodb";
242
+ import { KafkaBroker } from "hiot-kafka-broker";
243
+ import * as Logger from "bunyan";
244
+ import { Locator } from "hiot-app/locator";
245
+
246
+ export = () => new MongoDbBuilder();
247
+ export const createTopics: (client: any, topics: any) => any;
248
+ export const envelope: { parse: (consumer: any, payload: any, topic: any, partition: any, logger: Logger) => any };
249
+ export const logParser: (logger: Logger) => (...args: any[]) => void;
250
+
251
+ export const test = {
252
+ insert: (locator: Locator, context: any) => new Promise<void>(),
253
+ };
254
+
255
+ export class MongoDbBuilder {
256
+ options: {
257
+ server: string;
258
+ port: number;
259
+ groupId: string;
260
+ clientId: string;
261
+ createTopics: boolean;
262
+ logger: {
263
+ error: (...data: any[]) => void;
264
+ debug: (...data: any[]) => void;
265
+ info: (...data: any[]) => void;
266
+ trace: (...data: any[]) => void;
267
+ warn: (...data: any[]) => void;
268
+ };
269
+ handlers: () => void;
270
+ };
271
+ logger(logger: Logger): MongoDbBuilder;
272
+ handlers(handlers: any): MongoDbBuilder;
273
+ config(config: { host: string; port: number | string; database: string; replicaSet: string }): MongoDbBuilder;
274
+ build(): (locator: Locator) => Locator;
275
+
276
+ private constructor();
277
+ }
278
+
279
+ export enum ACL {
280
+ Write = "write",
281
+ Delete = "delete",
282
+ Read = "read",
283
+ }
284
+
285
+ export class Repository<T> {
286
+ name: string;
287
+ Type: T;
288
+ locator: Locator;
289
+
290
+ /**
291
+ * @param name mongodb collection name
292
+ * @param Type the (js) class definition for documents
293
+ * @param locator mongodb connection
294
+ */
295
+ constructor(name: string, Type: any, locator: Locator);
296
+
297
+ public getById(id: string, user?: ReqUser): Promise<T | undefined>;
298
+
299
+ public getAll(user: ReqUser | undefined, query: any): Promise<T[]>;
300
+
301
+ public getAllByPaging(query: any, sorting: any, size: number, page: number, user?: ReqUser): Promise<T[]>;
302
+
303
+ public getTotalCount(query: any): Promise<number>;
304
+
305
+ public patch(id: string, patch: any): Promise<T>;
306
+
307
+ public update(id: string, updateData: any, user?: ReqUser): Promise<T>;
308
+
309
+ public save(data: T, user?: ReqUser): Promise<T>;
310
+
311
+ public remove(id: string, user?: ReqUser): Promise<number>;
312
+
313
+ public collection(): Collection<T>;
314
+ }
315
+
316
+ export const queryBuilder: {
317
+ findFilter(user: ReqUser, search: any): any;
318
+
319
+ findOneFilter(id: string, user: ReqUser, acl: string): { $and: any[] };
320
+ };
321
+ }
322
+
323
+ declare module "hiot-app/httpClient" {
324
+ // import { AxiosInstance } from "axios";
325
+
326
+ type HttpForOptions = {
327
+ config: any;
328
+ apiUser?: string;
329
+ correlationId?: string;
330
+ };
331
+
332
+ function httpFor(options: HttpForOptions): any;
333
+
334
+ function handleResponse<T = any>(promise: PromiseLike, successStatus?: number): Promise<T>;
335
+
336
+ function fetchPaginatedResponse<T = any>(http: any, urlBasePath: string, pageSize: number = 50): Promise<T>;
337
+ }
338
+
339
+ declare module "hiot-app/setupNock" {
340
+ import nock from "nock";
341
+
342
+ function setupNock(): typeof nock;
343
+
344
+ export = setupNock;
345
+ }
346
+
347
+ declare module "hiot-app/generateHandleException" {
348
+ type Package = {
349
+ name: string;
350
+ version: number;
351
+ [x: string]: any;
352
+ };
353
+
354
+ type ProcessEnv = {
355
+ SENTRY_ENVIRONMENT?: string;
356
+ API_HOST?: string;
357
+ };
358
+
359
+ type GenerateHandleExceptionOptions = {
360
+ processEnv: any;
361
+ pkg: Package;
362
+ sentryRelease?: any;
363
+ };
364
+
365
+ function generateHandleException(options: GenerateHandleExceptionOptions): (err: any, metadata?: any) => any;
366
+
367
+ export = generateHandleException;
368
+ }
@@ -0,0 +1,11 @@
1
+ export = Activities;
2
+ declare function Activities(): void;
3
+ declare class Activities {
4
+ config: {
5
+ validators: {};
6
+ };
7
+ can(activity: any, validator: any): void;
8
+ deny(denier: any): void;
9
+ allow(allower: any): void;
10
+ }
11
+ //# sourceMappingURL=activities.d.ts.map
@@ -0,0 +1,77 @@
1
+ export = Configurator;
2
+
3
+ declare function Configurator(): void;
4
+
5
+ declare class Configurator {
6
+ activityRegistry: Registry;
7
+
8
+ identityRegistry: Registry;
9
+
10
+ routeHelpersConfig: RouteHelperConfig;
11
+
12
+ userIdentityConfig: UserIdentityConfig;
13
+
14
+ defaultIdentityType: string;
15
+
16
+ config: {
17
+ routeHelpers: {
18
+ validators: {};
19
+ getUser: (req: any, cb: any) => void;
20
+ parameterMaps: {};
21
+ };
22
+ userIdentity: {};
23
+ validators: {};
24
+ activities: Registry;
25
+ identities: Registry;
26
+ getActivities: (identityTypeName: any) => any;
27
+ getIdentity: (identityTypeName: any) => any;
28
+ };
29
+
30
+ getConfig(): {
31
+ routeHelpers: {
32
+ validators: {};
33
+ getUser: (req: any, cb: any) => void;
34
+ parameterMaps: {};
35
+ };
36
+ userIdentity: {};
37
+ validators: {};
38
+ activities: Registry;
39
+ identities: Registry;
40
+ getActivities: (identityTypeName: any) => any;
41
+ getIdentity: (identityTypeName: any) => any;
42
+ };
43
+
44
+ routeHelpers(cb: (config: RouteHelperConfig) => void): void;
45
+
46
+ userIdentity(cb: any): void;
47
+ addIdentity(identityTypeName: any, IdentityType: any): void;
48
+
49
+ activities(identityTypeName: any, cb: any): void;
50
+ activities(cb: (config: ActivityConfig) => void): void;
51
+ }
52
+ import Registry = require("../registry");
53
+ import RouteHelperConfig = require("./route-helpers");
54
+ import UserIdentityConfig = require("./user-identity");
55
+ //# sourceMappingURL=index.d.ts.map
56
+
57
+ declare class ActivityConfig {
58
+ config: {
59
+ validators: {};
60
+ denier: any;
61
+ allower: any;
62
+ };
63
+ can(activity: string, validator: (identity: any, params: any, cb: () => void) => void): void;
64
+ deny(denier: any): void;
65
+ allow(
66
+ cb: (
67
+ identity: {
68
+ user: {
69
+ userId: string;
70
+ activities: { [activity: string]: boolean };
71
+ };
72
+ },
73
+ activity: string,
74
+ cb: (err: any, permitted: boolean) => void
75
+ ) => void
76
+ ): void;
77
+ }
@@ -0,0 +1,8 @@
1
+ export = ParameterMap;
2
+ declare function ParameterMap(): void;
3
+ declare class ParameterMap {
4
+ maps: {};
5
+ getMaps(): {};
6
+ map(activity: any, mapper: any): void;
7
+ }
8
+ //# sourceMappingURL=parameter-map.d.ts.map
@@ -0,0 +1,17 @@
1
+ export = RouteHelpers;
2
+ declare function RouteHelpers(): void;
3
+ import { Request, Response, Next } from "restify";
4
+
5
+ declare class RouteHelpers {
6
+ config: {
7
+ validators: {};
8
+ getUser: typeof noGetUser;
9
+ parameterMaps: {};
10
+ };
11
+ getUser(cb: (req: Request, cb: (err: any, user: any) => void) => void): void;
12
+ notAuthenticated(cb: (req: Request, res: Response, next: Next) => void): void;
13
+ notAuthorized(cb: (req: Request, res: Response, next: Next) => void): void;
14
+ parameterMaps(cb: any): void;
15
+ }
16
+ declare function noGetUser(req: any, cb: any): void;
17
+ //# sourceMappingURL=route-helpers.d.ts.map
@@ -0,0 +1,7 @@
1
+ export = UserIdentity;
2
+ declare function UserIdentity(): void;
3
+ declare class UserIdentity {
4
+ config: {};
5
+ isAuthenticated(cb: any): void;
6
+ }
7
+ //# sourceMappingURL=user-identity.d.ts.map
@@ -0,0 +1,23 @@
1
+ export = MustBe;
2
+ declare function MustBe(): void;
3
+ import Configurator from "../../types/mustbe/config";
4
+ declare class MustBe {
5
+ configure(cb: (config: Configurator) => void): void;
6
+ config: {
7
+ routeHelpers: {
8
+ validators: {};
9
+ getUser: (req: any, cb: any) => void;
10
+ parameterMaps: {};
11
+ };
12
+ userIdentity: {};
13
+ validators: {};
14
+ activities: import("./registry");
15
+ identities: import("./registry");
16
+ getActivities: (identityTypeName: any) => any;
17
+ getIdentity: (identityTypeName: any) => any;
18
+ };
19
+ routeHelpers(): RouteHelpers;
20
+ getIdentity(identityTypeName: any): any;
21
+ }
22
+ import RouteHelpers = require("./routeHelpers");
23
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1,10 @@
1
+ export = UserIdentity;
2
+ declare function UserIdentity(user: any, config: any): void;
3
+ declare class UserIdentity {
4
+ constructor(user: any, config: any);
5
+ user: any;
6
+ config: any;
7
+ isAuthenticated(cb: any): any;
8
+ type: string;
9
+ }
10
+ //# sourceMappingURL=userIdentity.d.ts.map
@@ -0,0 +1,6 @@
1
+ // TODO: Temp or permanent solution, mustbe has no types what so ever, so 🤷‍♂️ for now
2
+
3
+ export = mustBe;
4
+ declare var mustBe: MustBe;
5
+ import MustBe = require("./core");
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ export = Principal;
2
+ declare function Principal(identity: any, verifier: any): void;
3
+ declare class Principal {
4
+ constructor(identity: any, verifier: any);
5
+ identity: any;
6
+ verifier: any;
7
+ isAuthenticated(cb: any): void;
8
+ isAuthorized(activity: any, requestParams: any, cb: any): void;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ export = Registry;
2
+ declare function Registry(defaultValue: any): void;
3
+ declare class Registry {
4
+ constructor(defaultValue: any);
5
+ _defaultValue: any;
6
+ _values: any;
7
+ register(name: any, value: any): void;
8
+ get(name: any): any;
9
+ hasValue(name: any): any;
10
+ }
11
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,20 @@
1
+ export = RouteHelpers;
2
+ declare function RouteHelpers(config: any): void;
3
+ declare class RouteHelpers {
4
+ constructor(config: any);
5
+ config: any;
6
+ authenticated(notAuthCB?: any): (req: any, res: any, next: any, ...args: any[]) => void;
7
+ authorizeIdentity(
8
+ identityTypeName: any,
9
+ activity: any,
10
+ notauthcb: any
11
+ ): (req: any, res: any, next: any, ...args: any[]) => void;
12
+ authorized(activity: any, notauthcb?: any): (req: any, res: any, next: any, ...args: any[]) => void;
13
+ _handleAuthorization(
14
+ activity: any,
15
+ notauthcb: any,
16
+ getIdentitycb: any
17
+ ): (req: any, res: any, next: any, ...args: any[]) => void;
18
+ getIdentity(identityTypeName: any, config: any): any;
19
+ }
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ export = Verifier;
2
+ declare function Verifier(identity: any, config: any): void;
3
+ declare class Verifier {
4
+ constructor(identity: any, config: any);
5
+ identity: any;
6
+ config: any;
7
+ activities: any;
8
+ isAuthorized(activity: any, requestParams: any, cb: any): void;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map