@conduitplatform/grpc-sdk 0.16.0-alpha.1 → 0.16.0-alpha.11

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 (222) hide show
  1. package/README.mdx +1 -7
  2. package/dist/classes/ConduitModule.d.ts +9 -6
  3. package/dist/classes/ConduitModule.js +85 -48
  4. package/dist/classes/ConduitModule.js.map +1 -1
  5. package/dist/classes/ConduitSchema.js.map +1 -1
  6. package/dist/classes/HealthCheck.js +36 -9
  7. package/dist/classes/HealthCheck.js.map +1 -1
  8. package/dist/classes/index.d.ts +2 -6
  9. package/dist/classes/index.js +2 -6
  10. package/dist/classes/index.js.map +1 -1
  11. package/dist/index.d.ts +33 -31
  12. package/dist/index.js +155 -176
  13. package/dist/index.js.map +1 -1
  14. package/dist/interceptors/grpcSignedToken.d.ts +1 -1
  15. package/dist/interceptors/grpcSignedToken.js +2 -2
  16. package/dist/interceptors/moduleName.d.ts +1 -1
  17. package/dist/interceptors/moduleName.js +2 -2
  18. package/dist/interfaces/ConduitMiddleware.js.map +1 -0
  19. package/dist/{routing/interfaces → interfaces}/ConduitRoute.d.ts +2 -3
  20. package/dist/interfaces/ConduitRoute.js.map +1 -0
  21. package/dist/{routing → interfaces}/ConduitRouteReturn.d.ts +3 -3
  22. package/dist/interfaces/ConduitRouteReturn.js.map +1 -0
  23. package/dist/interfaces/ConduitSchemaExtension.d.ts +1 -1
  24. package/dist/interfaces/GrpcCallback.d.ts +1 -1
  25. package/dist/{utilities/Logger.d.ts → interfaces/IConduitLogger.d.ts} +4 -7
  26. package/dist/interfaces/{ConduitService.js → IConduitLogger.js} +1 -1
  27. package/dist/interfaces/IConduitLogger.js.map +1 -0
  28. package/dist/{metrics/index.d.ts → interfaces/IConduitMetrics.d.ts} +5 -11
  29. package/dist/interfaces/IConduitMetrics.js +3 -0
  30. package/dist/interfaces/IConduitMetrics.js.map +1 -0
  31. package/dist/interfaces/Indexable.d.ts +7 -8
  32. package/dist/interfaces/Model.d.ts +63 -13
  33. package/dist/interfaces/Model.js.map +1 -1
  34. package/dist/interfaces/Params.d.ts +3 -3
  35. package/dist/interfaces/ProxyRoute.js.map +1 -0
  36. package/dist/interfaces/RawQuery.d.ts +2 -2
  37. package/dist/interfaces/Route.d.ts +61 -0
  38. package/dist/interfaces/Route.js +12 -0
  39. package/dist/interfaces/Route.js.map +1 -0
  40. package/dist/{routing/interfaces → interfaces}/Socket.d.ts +4 -5
  41. package/dist/interfaces/Socket.js.map +1 -0
  42. package/dist/interfaces/UntypedArray.d.ts +1 -1
  43. package/dist/interfaces/index.d.ts +9 -2
  44. package/dist/interfaces/index.js +9 -2
  45. package/dist/interfaces/index.js.map +1 -1
  46. package/dist/{routing/interfaces → interfaces}/types.d.ts +11 -9
  47. package/dist/{routing/interfaces → interfaces}/types.js.map +1 -1
  48. package/dist/module.proto +72 -0
  49. package/dist/modules/admin/index.d.ts +5 -5
  50. package/dist/modules/admin/index.js +12 -13
  51. package/dist/modules/admin/index.js.map +1 -1
  52. package/dist/modules/authorization/index.d.ts +3 -2
  53. package/dist/modules/authorization/index.js +4 -4
  54. package/dist/modules/authorization/index.js.map +1 -1
  55. package/dist/modules/config/index.d.ts +5 -5
  56. package/dist/modules/config/index.js +38 -28
  57. package/dist/modules/config/index.js.map +1 -1
  58. package/dist/modules/database/index.d.ts +6 -5
  59. package/dist/modules/database/index.js +15 -15
  60. package/dist/modules/database/index.js.map +1 -1
  61. package/dist/modules/index.d.ts +0 -2
  62. package/dist/modules/index.js +0 -2
  63. package/dist/modules/index.js.map +1 -1
  64. package/dist/modules/router/index.d.ts +5 -5
  65. package/dist/modules/router/index.js +10 -11
  66. package/dist/modules/router/index.js.map +1 -1
  67. package/dist/modules/storage/index.d.ts +6 -2
  68. package/dist/modules/storage/index.js +22 -2
  69. package/dist/modules/storage/index.js.map +1 -1
  70. package/dist/protoUtils/authentication.d.ts +3 -48
  71. package/dist/protoUtils/authentication.js +1 -110
  72. package/dist/protoUtils/authentication.js.map +1 -1
  73. package/dist/protoUtils/authorization.d.ts +28 -82
  74. package/dist/protoUtils/authorization.js +10 -156
  75. package/dist/protoUtils/authorization.js.map +1 -1
  76. package/dist/protoUtils/chat.d.ts +7 -61
  77. package/dist/protoUtils/chat.js +3 -149
  78. package/dist/protoUtils/chat.js.map +1 -1
  79. package/dist/protoUtils/core.d.ts +85 -107
  80. package/dist/protoUtils/core.js +101 -203
  81. package/dist/protoUtils/core.js.map +1 -1
  82. package/dist/protoUtils/database.d.ts +7 -17
  83. package/dist/protoUtils/database.js +3 -41
  84. package/dist/protoUtils/database.js.map +1 -1
  85. package/dist/protoUtils/email.d.ts +3 -48
  86. package/dist/protoUtils/email.js +1 -110
  87. package/dist/protoUtils/email.js.map +1 -1
  88. package/dist/protoUtils/google/protobuf/empty.d.ts +27 -0
  89. package/dist/protoUtils/google/protobuf/empty.js +47 -0
  90. package/dist/protoUtils/google/protobuf/empty.js.map +1 -0
  91. package/dist/protoUtils/grpc_health_check.d.ts +3 -4
  92. package/dist/protoUtils/grpc_health_check.js +1 -2
  93. package/dist/protoUtils/grpc_health_check.js.map +1 -1
  94. package/dist/protoUtils/index.d.ts +12 -0
  95. package/dist/{routing/interfaces → protoUtils}/index.js +12 -6
  96. package/dist/protoUtils/index.js.map +1 -0
  97. package/dist/protoUtils/module.d.ts +251 -0
  98. package/dist/protoUtils/module.js +882 -0
  99. package/dist/protoUtils/module.js.map +1 -0
  100. package/dist/protoUtils/push-notifications.d.ts +3 -48
  101. package/dist/protoUtils/push-notifications.js +1 -110
  102. package/dist/protoUtils/push-notifications.js.map +1 -1
  103. package/dist/protoUtils/router.d.ts +45 -111
  104. package/dist/protoUtils/router.js +100 -310
  105. package/dist/protoUtils/router.js.map +1 -1
  106. package/dist/protoUtils/sms.d.ts +3 -48
  107. package/dist/protoUtils/sms.js +1 -110
  108. package/dist/protoUtils/sms.js.map +1 -1
  109. package/dist/protoUtils/storage.d.ts +134 -62
  110. package/dist/protoUtils/storage.js +433 -170
  111. package/dist/protoUtils/storage.js.map +1 -1
  112. package/dist/types/db.d.ts +11 -11
  113. package/dist/types/index.d.ts +3 -10
  114. package/dist/types/index.js +15 -0
  115. package/dist/types/index.js.map +1 -1
  116. package/dist/utilities/RedisManager.js.map +1 -1
  117. package/dist/utilities/env.d.ts +1 -0
  118. package/dist/utilities/env.js +37 -0
  119. package/dist/utilities/env.js.map +1 -0
  120. package/dist/utilities/index.d.ts +4 -2
  121. package/dist/utilities/index.js +4 -2
  122. package/dist/utilities/index.js.map +1 -1
  123. package/package.json +24 -25
  124. package/dist/classes/ConduitActiveSchema.d.ts +0 -19
  125. package/dist/classes/ConduitActiveSchema.js +0 -57
  126. package/dist/classes/ConduitActiveSchema.js.map +0 -1
  127. package/dist/classes/ConduitServiceModule.d.ts +0 -26
  128. package/dist/classes/ConduitServiceModule.js +0 -166
  129. package/dist/classes/ConduitServiceModule.js.map +0 -1
  130. package/dist/classes/ConfigController.d.ts +0 -7
  131. package/dist/classes/ConfigController.js +0 -27
  132. package/dist/classes/ConfigController.js.map +0 -1
  133. package/dist/classes/GrpcServer.d.ts +0 -22
  134. package/dist/classes/GrpcServer.js +0 -207
  135. package/dist/classes/GrpcServer.js.map +0 -1
  136. package/dist/classes/ManagedModule.d.ts +0 -74
  137. package/dist/classes/ManagedModule.js +0 -333
  138. package/dist/classes/ManagedModule.js.map +0 -1
  139. package/dist/classes/ModuleManager.d.ts +0 -11
  140. package/dist/classes/ModuleManager.js +0 -205
  141. package/dist/classes/ModuleManager.js.map +0 -1
  142. package/dist/helpers/GrpcHelper.d.ts +0 -8
  143. package/dist/helpers/GrpcHelper.js +0 -43
  144. package/dist/helpers/GrpcHelper.js.map +0 -1
  145. package/dist/helpers/TypeHelpers.d.ts +0 -44
  146. package/dist/helpers/TypeHelpers.js +0 -144
  147. package/dist/helpers/TypeHelpers.js.map +0 -1
  148. package/dist/helpers/index.d.ts +0 -3
  149. package/dist/helpers/index.js +0 -20
  150. package/dist/helpers/index.js.map +0 -1
  151. package/dist/helpers/wrapGrpcFunctions.d.ts +0 -5
  152. package/dist/helpers/wrapGrpcFunctions.js +0 -56
  153. package/dist/helpers/wrapGrpcFunctions.js.map +0 -1
  154. package/dist/interfaces/ConduitService.d.ts +0 -8
  155. package/dist/interfaces/ConduitService.js.map +0 -1
  156. package/dist/metrics/MetricsServer.d.ts +0 -9
  157. package/dist/metrics/MetricsServer.js +0 -94
  158. package/dist/metrics/MetricsServer.js.map +0 -1
  159. package/dist/metrics/clientMiddleware.d.ts +0 -2
  160. package/dist/metrics/clientMiddleware.js +0 -265
  161. package/dist/metrics/clientMiddleware.js.map +0 -1
  162. package/dist/metrics/config/defaults.d.ts +0 -91
  163. package/dist/metrics/config/defaults.js +0 -93
  164. package/dist/metrics/config/defaults.js.map +0 -1
  165. package/dist/metrics/index.js +0 -152
  166. package/dist/metrics/index.js.map +0 -1
  167. package/dist/modules/forms/index.d.ts +0 -6
  168. package/dist/modules/forms/index.js +0 -32
  169. package/dist/modules/forms/index.js.map +0 -1
  170. package/dist/modules/functions/index.d.ts +0 -6
  171. package/dist/modules/functions/index.js +0 -32
  172. package/dist/modules/functions/index.js.map +0 -1
  173. package/dist/protoUtils/forms.d.ts +0 -58
  174. package/dist/protoUtils/forms.js +0 -127
  175. package/dist/protoUtils/forms.js.map +0 -1
  176. package/dist/protoUtils/functions.d.ts +0 -58
  177. package/dist/protoUtils/functions.js +0 -127
  178. package/dist/protoUtils/functions.js.map +0 -1
  179. package/dist/routing/ConduitRouteReturn.js.map +0 -1
  180. package/dist/routing/ProxyRouteBuilder.d.ts +0 -21
  181. package/dist/routing/ProxyRouteBuilder.js +0 -81
  182. package/dist/routing/ProxyRouteBuilder.js.map +0 -1
  183. package/dist/routing/RouteBuilder.d.ts +0 -24
  184. package/dist/routing/RouteBuilder.js +0 -107
  185. package/dist/routing/RouteBuilder.js.map +0 -1
  186. package/dist/routing/RoutingManager.d.ts +0 -33
  187. package/dist/routing/RoutingManager.js +0 -201
  188. package/dist/routing/RoutingManager.js.map +0 -1
  189. package/dist/routing/RoutingUtilities.d.ts +0 -7
  190. package/dist/routing/RoutingUtilities.js +0 -13
  191. package/dist/routing/RoutingUtilities.js.map +0 -1
  192. package/dist/routing/index.d.ts +0 -7
  193. package/dist/routing/index.js +0 -24
  194. package/dist/routing/index.js.map +0 -1
  195. package/dist/routing/interfaces/ConduitMiddleware.js.map +0 -1
  196. package/dist/routing/interfaces/ConduitRoute.js.map +0 -1
  197. package/dist/routing/interfaces/ProxyRoute.js.map +0 -1
  198. package/dist/routing/interfaces/Route.d.ts +0 -52
  199. package/dist/routing/interfaces/Route.js +0 -21
  200. package/dist/routing/interfaces/Route.js.map +0 -1
  201. package/dist/routing/interfaces/Socket.js.map +0 -1
  202. package/dist/routing/interfaces/index.d.ts +0 -6
  203. package/dist/routing/interfaces/index.js.map +0 -1
  204. package/dist/routing/wrapRouterFunctions.d.ts +0 -8
  205. package/dist/routing/wrapRouterFunctions.js +0 -132
  206. package/dist/routing/wrapRouterFunctions.js.map +0 -1
  207. package/dist/utilities/Logger.js +0 -255
  208. package/dist/utilities/Logger.js.map +0 -1
  209. package/dist/utilities/linearBackoffTimeout.d.ts +0 -10
  210. package/dist/utilities/linearBackoffTimeout.js +0 -119
  211. package/dist/utilities/linearBackoffTimeout.js.map +0 -1
  212. package/dist/utilities/merge.d.ts +0 -1
  213. package/dist/utilities/merge.js +0 -15
  214. package/dist/utilities/merge.js.map +0 -1
  215. /package/dist/{routing/interfaces → interfaces}/ConduitMiddleware.d.ts +0 -0
  216. /package/dist/{routing/interfaces → interfaces}/ConduitMiddleware.js +0 -0
  217. /package/dist/{routing/interfaces → interfaces}/ConduitRoute.js +0 -0
  218. /package/dist/{routing → interfaces}/ConduitRouteReturn.js +0 -0
  219. /package/dist/{routing/interfaces → interfaces}/ProxyRoute.d.ts +0 -0
  220. /package/dist/{routing/interfaces → interfaces}/ProxyRoute.js +0 -0
  221. /package/dist/{routing/interfaces → interfaces}/Socket.js +0 -0
  222. /package/dist/{routing/interfaces → interfaces}/types.js +0 -0
@@ -1,9 +1,7 @@
1
- import { Indexable } from '../interfaces';
2
1
  import winston, { LogCallback, Logger } from 'winston';
3
- export declare class ConduitLogger {
4
- private readonly _winston;
5
- constructor(transports?: winston.transport[]);
6
- addTransport(transport: winston.transport): void;
2
+ import { Indexable } from './Indexable';
3
+ export interface IConduitLogger {
4
+ get winston(): winston.Logger;
7
5
  log(message: string, level?: string, cb?: LogCallback): Logger;
8
6
  logObject(object: Indexable, message?: string, level?: string, cb?: LogCallback): Logger;
9
7
  info(message: string, cb?: LogCallback): Logger;
@@ -11,6 +9,5 @@ export declare class ConduitLogger {
11
9
  error(message: string | Error, cb?: LogCallback): Logger;
12
10
  http(message: string, cb?: LogCallback): Logger;
13
11
  verbose(message: string, cb?: LogCallback): Logger;
14
- get winston(): winston.Logger;
12
+ addTransport(transport: winston.transport): void;
15
13
  }
16
- export declare function setupLoki(module: string, instance: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ConduitService.js.map
3
+ //# sourceMappingURL=IConduitLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConduitLogger.js","sourceRoot":"","sources":["../../src/interfaces/IConduitLogger.ts"],"names":[],"mappings":""}
@@ -1,22 +1,16 @@
1
- import { Counter, CounterConfiguration, Gauge, GaugeConfiguration, Histogram, HistogramConfiguration, LabelValues, Summary, SummaryConfiguration } from 'prom-client';
2
- import { MetricConfiguration, MetricType } from '../types';
3
- export declare class ConduitMetrics {
4
- private readonly moduleName;
5
- private readonly instance;
6
- private readonly _registry;
7
- private _httpServer;
8
- constructor(moduleName: string, instance: string);
1
+ import { Counter, CounterConfiguration, Gauge, GaugeConfiguration, Histogram, HistogramConfiguration, LabelValues, Metric, MetricConfiguration, Summary, SummaryConfiguration } from 'prom-client';
2
+ import { MetricType } from '../types';
3
+ export interface IConduitMetrics {
9
4
  initializeDefaultMetrics(): void;
10
- registerMetric(type: MetricType, config: MetricConfiguration): void;
5
+ registerMetric(type: MetricType, config: MetricConfiguration<string>): void;
11
6
  collectDefaultMetrics(): void;
12
7
  createCounter(config: CounterConfiguration<any>): Counter<any>;
13
8
  createSummary(config: SummaryConfiguration<any>): Summary<any>;
14
9
  createHistogram(config: HistogramConfiguration<any>): Histogram<any>;
15
10
  createGauge(config: GaugeConfiguration<any>): Gauge<any>;
16
- getMetric(name: string): import("prom-client").Metric<string> | undefined;
11
+ getMetric(name: string): Metric<string> | undefined;
17
12
  increment(metric: string, increment?: number, labels?: LabelValues<any>): void;
18
13
  decrement(metric: string, decrement?: number, labels?: LabelValues<any>): void;
19
14
  set(metric: string, value: number, labels?: LabelValues<any>): void;
20
15
  observe(metric: string, value: number, labels?: LabelValues<any>): void;
21
- private addPrefix;
22
16
  }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IConduitMetrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConduitMetrics.js","sourceRoot":"","sources":["../../src/interfaces/IConduitMetrics.ts"],"names":[],"mappings":""}
@@ -1,10 +1,9 @@
1
- export declare type Indexable = {
1
+ export type Indexable = {
2
2
  [key: string]: any;
3
3
  };
4
- export declare type Params = Indexable;
5
- export declare type Document = Indexable;
6
- export declare type Route = Indexable;
7
- export declare type Headers = Indexable;
8
- export declare type Context = Indexable;
9
- export declare type Cookies = Indexable;
10
- export declare type Query = Indexable;
4
+ export type Params = Indexable;
5
+ export type Document = Indexable;
6
+ export type Route = Indexable;
7
+ export type Headers = Indexable;
8
+ export type Context = Indexable;
9
+ export type Cookies = Indexable;
@@ -1,4 +1,3 @@
1
- import { UntypedArray } from './UntypedArray';
2
1
  export declare enum TYPE {
3
2
  String = "String",
4
3
  Number = "Number",
@@ -38,23 +37,73 @@ export declare enum PostgresIndexType {
38
37
  GIN = "GIN",
39
38
  BRIN = "BRIN"
40
39
  }
41
- export declare type Array = any[];
42
- export interface ConduitModelField {
43
- type?: TYPE | Array | ConduitModel | ConduitModelField;
40
+ export type Array = any[];
41
+ type BaseConduitModelField = {
42
+ type?: TYPE | TYPE[] | ConduitModel | ArrayConduitModel[];
44
43
  sqlType?: SQLDataType;
45
- enum?: any;
46
44
  default?: any;
47
- model?: string;
48
- unique?: boolean;
45
+ description?: string;
46
+ required?: boolean;
49
47
  select?: boolean;
48
+ };
49
+ type UniqueAndRequiredField = {
50
+ unique: true;
51
+ required: true;
52
+ index?: SchemaFieldIndex;
53
+ };
54
+ type NotUniqueField = {
55
+ unique?: false;
50
56
  required?: boolean;
51
- description?: string;
52
- systemRequired?: boolean;
53
57
  index?: SchemaFieldIndex;
54
- }
55
- export interface ConduitModel {
56
- [field: string]: ConduitModelField | ConduitModelField[] | ConduitModel | TYPE | TYPE[] | UntypedArray;
57
- }
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
+ };
58
107
  export declare const ConduitModelOptionsPermModifyType: string[];
59
108
  export interface ConduitSchemaOptions {
60
109
  timestamps?: boolean;
@@ -115,3 +164,4 @@ export interface PostgresIndexOptions {
115
164
  [opt: string]: any;
116
165
  };
117
166
  }
167
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/interfaces/Model.ts"],"names":[],"mappings":";;;AAEA,IAAY,IAQX;AARD,WAAY,IAAI;IACd,yBAAiB,CAAA;IACjB,yBAAiB,CAAA;IACjB,2BAAmB,CAAA;IACnB,qBAAa,CAAA;IACb,6BAAqB,CAAA;IACrB,qBAAa,CAAA;IACb,6BAAqB,CAAA;AACvB,CAAC,EARW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQf;AAED,IAAY,WAYX;AAZD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;AACzB,CAAC,EAZW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAYtB;AAED,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,6DAAa,CAAA;IACb,gEAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,iDAA+B,CAAA;IAC/B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB;AAED,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACf,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B;AA4BY,QAAA,iCAAiC,GAAG;IAC/C,YAAY;IACZ,SAAS;IACT,eAAe;CAChB,CAAC"}
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/interfaces/Model.ts"],"names":[],"mappings":";;;AAAA,IAAY,IAQX;AARD,WAAY,IAAI;IACd,yBAAiB,CAAA;IACjB,yBAAiB,CAAA;IACjB,2BAAmB,CAAA;IACnB,qBAAa,CAAA;IACb,6BAAqB,CAAA;IACrB,qBAAa,CAAA;IACb,6BAAqB,CAAA;AACvB,CAAC,EARW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQf;AAED,IAAY,WAYX;AAZD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;AACzB,CAAC,EAZW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAYtB;AAED,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,6DAAa,CAAA;IACb,gEAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,iDAA+B,CAAA;IAC/B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB;AAED,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACf,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B;AAkGY,QAAA,iCAAiC,GAAG;IAC/C,YAAY;IACZ,SAAS;IACT,eAAe;CAChB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { Indexable } from './Indexable';
2
- export declare type UrlParams = {
2
+ export type UrlParams = {
3
3
  [key: string]: string;
4
4
  };
5
- export declare type QueryParams = {
5
+ export type QueryParams = {
6
6
  [key: string]: string | string[];
7
7
  };
8
- export declare type BodyParams = Indexable;
8
+ export type BodyParams = Indexable;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProxyRoute.js","sourceRoot":"","sources":["../../src/interfaces/ProxyRoute.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,mCAAc,CAAA;IACd,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;AACb,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B"}
@@ -2,7 +2,7 @@ export interface RawQuery {
2
2
  mongoQuery?: RawMongoQuery;
3
3
  sqlQuery?: RawSQLQuery;
4
4
  }
5
- export declare type RawMongoQuery = {
5
+ export type RawMongoQuery = {
6
6
  aggregate?: object[];
7
7
  count?: object;
8
8
  deleteOne?: object;
@@ -16,7 +16,7 @@ export declare type RawMongoQuery = {
16
16
  updateMany?: object | object[];
17
17
  options?: object;
18
18
  };
19
- export declare type RawSQLQuery = {
19
+ export type RawSQLQuery = {
20
20
  query: string;
21
21
  options?: object;
22
22
  };
@@ -0,0 +1,61 @@
1
+ import { allowedTypes, ConduitModel, TYPE } from './Model';
2
+ import { Indexable } from './Indexable';
3
+ export interface ConduitRouteParameters {
4
+ params?: Indexable;
5
+ path?: string;
6
+ headers: Indexable;
7
+ context?: Indexable;
8
+ cookies?: Indexable;
9
+ bodyParams?: Indexable;
10
+ urlParams?: Indexable;
11
+ queryParams?: Indexable;
12
+ }
13
+ type AllowedTypes = TYPE.String | TYPE.Number | TYPE.Boolean | TYPE.Date | TYPE.ObjectId;
14
+ export type ConduitUrlParam = AllowedTypes | {
15
+ type: AllowedTypes;
16
+ required?: boolean;
17
+ };
18
+ export type ConduitQueryParam = ConduitUrlParam | AllowedTypes[] | {
19
+ type: AllowedTypes[];
20
+ required?: boolean;
21
+ };
22
+ export type ConduitUrlParams = {
23
+ [field in string]: ConduitUrlParam;
24
+ };
25
+ export type ConduitQueryParams = {
26
+ [field in string]: ConduitQueryParam;
27
+ };
28
+ export type ConduitReturnField = keyof typeof TYPE | TYPE | ConduitModel | {
29
+ [key: string]: TYPE | TYPE[] | ConduitModel | ConduitModel[];
30
+ };
31
+ export type ConduitReturnModel = {
32
+ [field: string]: ConduitReturnField | allowedTypes | allowedTypes[] | string | string[];
33
+ };
34
+ export type ConduitReturn = ConduitReturnField | ConduitReturnModel | string;
35
+ export declare enum ConduitRouteActions {
36
+ GET = "GET",
37
+ POST = "POST",
38
+ UPDATE = "PUT",
39
+ PATCH = "PATCH",
40
+ DELETE = "DELETE"
41
+ }
42
+ export interface ConduitRouteOptions {
43
+ queryParams?: ConduitQueryParams;
44
+ bodyParams?: ConduitModel;
45
+ urlParams?: ConduitUrlParams;
46
+ action: ConduitRouteActions;
47
+ path: string;
48
+ name?: string;
49
+ description?: string;
50
+ middlewares?: string[];
51
+ cacheControl?: string;
52
+ }
53
+ export interface ConduitRouteObject {
54
+ options: ConduitRouteOptions;
55
+ returns: {
56
+ name: string;
57
+ fields: ConduitReturn;
58
+ };
59
+ grpcFunction: string;
60
+ }
61
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConduitRouteActions = void 0;
4
+ var ConduitRouteActions;
5
+ (function (ConduitRouteActions) {
6
+ ConduitRouteActions["GET"] = "GET";
7
+ ConduitRouteActions["POST"] = "POST";
8
+ ConduitRouteActions["UPDATE"] = "PUT";
9
+ ConduitRouteActions["PATCH"] = "PATCH";
10
+ ConduitRouteActions["DELETE"] = "DELETE";
11
+ })(ConduitRouteActions = exports.ConduitRouteActions || (exports.ConduitRouteActions = {}));
12
+ //# sourceMappingURL=Route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Route.js","sourceRoot":"","sources":["../../src/interfaces/Route.ts"],"names":[],"mappings":";;;AA4CA,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,qCAAc,CAAA;IACd,sCAAe,CAAA;IACf,wCAAiB,CAAA;AACnB,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B"}
@@ -1,7 +1,6 @@
1
- import { ConduitRouteReturnDefinition } from '../ConduitRouteReturn';
2
- import { RequestHandlers } from '../wrapRouterFunctions';
3
- import { TYPE } from '../../interfaces';
4
- export declare type ConduitSocketParamTypes = (TYPE | ConduitSocketParamTypes)[];
1
+ import { ConduitRouteReturnDefinition } from './ConduitRouteReturn';
2
+ import { TYPE } from './Model';
3
+ export type ConduitSocketParamTypes = (TYPE | ConduitSocketParamTypes)[];
5
4
  export interface ConduitSocketOptions {
6
5
  path: string;
7
6
  name?: string;
@@ -11,7 +10,7 @@ export interface ConduitSocketOptions {
11
10
  export interface ConduitSocketEventHandler {
12
11
  params?: ConduitSocketParamTypes;
13
12
  returnType?: ConduitRouteReturnDefinition;
14
- handler: RequestHandlers;
13
+ handler: any;
15
14
  }
16
15
  export interface EventsProtoDescription {
17
16
  [name: string]: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Socket.js","sourceRoot":"","sources":["../../src/interfaces/Socket.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- export declare type UntypedArray = any[];
1
+ export type UntypedArray = any[];
@@ -1,8 +1,15 @@
1
- export * from './ConduitSchemaExtension';
2
- export * from './ConduitService';
1
+ export * from './ConduitMiddleware';
2
+ export * from './ConduitRoute';
3
+ export * from './ProxyRoute';
4
+ export * from './Route';
5
+ export * from './Socket';
6
+ export * from './types';
3
7
  export * from './Model';
4
8
  export * from './GrpcCallback';
5
9
  export * from './Indexable';
6
10
  export * from './RawQuery';
7
11
  export * from './UntypedArray';
8
12
  export * from './Params';
13
+ export * from './ConduitRouteReturn';
14
+ export * from './IConduitLogger';
15
+ export * from './IConduitMetrics';
@@ -14,12 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ConduitSchemaExtension"), exports);
18
- __exportStar(require("./ConduitService"), exports);
17
+ __exportStar(require("./ConduitMiddleware"), exports);
18
+ __exportStar(require("./ConduitRoute"), exports);
19
+ __exportStar(require("./ProxyRoute"), exports);
20
+ __exportStar(require("./Route"), exports);
21
+ __exportStar(require("./Socket"), exports);
22
+ __exportStar(require("./types"), exports);
19
23
  __exportStar(require("./Model"), exports);
20
24
  __exportStar(require("./GrpcCallback"), exports);
21
25
  __exportStar(require("./Indexable"), exports);
22
26
  __exportStar(require("./RawQuery"), exports);
23
27
  __exportStar(require("./UntypedArray"), exports);
24
28
  __exportStar(require("./Params"), exports);
29
+ __exportStar(require("./ConduitRouteReturn"), exports);
30
+ __exportStar(require("./IConduitLogger"), exports);
31
+ __exportStar(require("./IConduitMetrics"), exports);
25
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,mDAAiC;AACjC,0CAAwB;AACxB,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iDAA+B;AAC/B,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,2CAAyB;AACzB,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC"}
@@ -1,35 +1,37 @@
1
- import { Context, Cookies, Headers, Indexable, Params } from '../../interfaces';
2
- import { GrpcRequest } from '../../types';
3
- export declare type ParsedRouterRequest = GrpcRequest<{
1
+ import { Context, Cookies, Indexable, Params } from './Indexable';
2
+ import { GrpcRequest } from '../types';
3
+ export type ParsedRouterRequest = GrpcRequest<{
4
4
  params: Params;
5
5
  urlParams: Params;
6
6
  queryParams: Params;
7
7
  bodyParams: Params;
8
8
  path: string;
9
- headers: Headers;
9
+ headers: Headers & {
10
+ authorization?: string;
11
+ };
10
12
  context: Context;
11
13
  cookies: Cookies;
12
14
  }>;
13
- export declare type UnparsedRouterResponse = {
15
+ export type UnparsedRouterResponse = {
14
16
  result?: Indexable;
15
17
  redirect?: string;
16
18
  setCookies: Cookies[];
17
19
  removeCookies: Cookies[];
18
20
  } | Indexable | string;
19
- export declare type ParsedSocketRequest = GrpcRequest<{
21
+ export type ParsedSocketRequest = GrpcRequest<{
20
22
  event: string;
21
23
  socketId: string;
22
24
  params: string[];
23
25
  context: Context;
24
26
  cookies: Cookies;
25
27
  }>;
26
- declare type EventResponse = {
28
+ type EventResponse = {
27
29
  event: string;
28
30
  data: Indexable;
29
31
  receivers?: string[];
30
32
  };
31
- export declare type UnparsedSocketResponse = EventResponse | JoinRoomResponse;
32
- declare type JoinRoomResponse = {
33
+ export type UnparsedSocketResponse = EventResponse | JoinRoomResponse;
34
+ type JoinRoomResponse = {
33
35
  rooms: string[];
34
36
  };
35
37
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/routing/interfaces/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,72 @@
1
+ syntax = "proto3";
2
+ package conduit.module.v1;
3
+
4
+ message SetConfigRequest {
5
+ string newConfig = 1;
6
+ }
7
+
8
+ message SetConfigResponse {
9
+ string updatedConfig = 1;
10
+ }
11
+
12
+ service ConduitModule {
13
+ rpc SetConfig(SetConfigRequest) returns (SetConfigResponse);
14
+ }
15
+
16
+ service ClientRouter {
17
+ rpc Route(Request) returns (Response);
18
+ rpc SocketRoute(SocketRequest) returns (SocketResponse);
19
+ }
20
+ service AdminRouter {
21
+ rpc Route(Request) returns (Response);
22
+ rpc SocketRoute(SocketRequest) returns (SocketResponse);
23
+ }
24
+
25
+ message Request {
26
+ string params = 1;
27
+ string path = 2;
28
+ string headers = 3;
29
+ string context = 4;
30
+ string cookies = 5;
31
+ string bodyParams = 6;
32
+ string urlParams = 7;
33
+ string queryParams = 8;
34
+ string functionName = 9;
35
+ }
36
+
37
+ message Response {
38
+ string result = 1;
39
+ string redirect = 2;
40
+ repeated Cookie setCookies = 3;
41
+ repeated Cookie removeCookies = 4;
42
+ }
43
+ message Cookie {
44
+ string name = 1;
45
+ optional string value = 2;
46
+ CookieOptions options = 3;
47
+ }
48
+
49
+ message CookieOptions {
50
+ bool httpOnly = 1;
51
+ bool secure = 2;
52
+ bool signed = 3;
53
+ int32 maxAge = 4;
54
+ string path = 5;
55
+ string domain = 6;
56
+ string sameSite = 7;
57
+
58
+ }
59
+ message SocketRequest {
60
+ string event = 1;
61
+ string socketId = 2;
62
+ string params = 3;
63
+ string context = 4;
64
+ string functionName = 5;
65
+ }
66
+
67
+ message SocketResponse {
68
+ string event = 1;
69
+ string data = 2;
70
+ repeated string receivers = 3;
71
+ repeated string rooms = 4;
72
+ }
@@ -1,9 +1,9 @@
1
- import { ConduitModule } from '../../classes/ConduitModule';
2
- import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils/core';
3
- import { ConduitProxyObject, ConduitRouteObject, SocketProtoDescription } from '../../routing';
1
+ import { ConduitModule } from '../../classes';
2
+ import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils';
3
+ import { ConduitRouteActions } from '../../interfaces';
4
4
  export declare class Admin extends ConduitModule<typeof AdminDefinition> {
5
5
  readonly moduleName: string;
6
6
  constructor(moduleName: string, url: string, grpcToken?: string);
7
- generateProtoFile(moduleName: string, routes: (ConduitRouteObject | SocketProtoDescription | ConduitProxyObject)[]): Promise<import("../../protoUtils/core").GenerateProtoResponse>;
8
- register(paths: RegisterAdminRouteRequest_PathDefinition[], protoFile: string, serverUrl?: string): Promise<any>;
7
+ register(paths: RegisterAdminRouteRequest_PathDefinition[], serverUrl?: string): Promise<any>;
8
+ patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
9
9
  }
@@ -16,32 +16,31 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Admin = void 0;
19
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var core_1 = require("../../protoUtils/core");
19
+ var classes_1 = require("../../classes");
20
+ var protoUtils_1 = require("../../protoUtils");
21
21
  var Admin = /** @class */ (function (_super) {
22
22
  __extends(Admin, _super);
23
23
  function Admin(moduleName, url, grpcToken) {
24
24
  var _this = _super.call(this, moduleName, 'admin', url, grpcToken) || this;
25
25
  _this.moduleName = moduleName;
26
- _this.initializeClient(core_1.AdminDefinition);
26
+ _this.initializeClient(protoUtils_1.AdminDefinition);
27
27
  return _this;
28
28
  }
29
- Admin.prototype.generateProtoFile = function (moduleName, routes) {
30
- var request = {
31
- moduleName: moduleName,
32
- routes: routes.map(function (r) { return JSON.stringify(r); }),
33
- };
34
- return this.client.generateProto(request);
35
- };
36
- Admin.prototype.register = function (paths, protoFile, serverUrl) {
29
+ Admin.prototype.register = function (paths, serverUrl) {
37
30
  var request = {
38
31
  routes: paths,
39
- protoFile: protoFile,
40
32
  routerUrl: serverUrl,
41
33
  };
42
34
  return this.client.registerAdminRoute(request);
43
35
  };
36
+ Admin.prototype.patchRouteMiddlewares = function (path, action, middlewares) {
37
+ return this.client.patchRouteMiddlewares({
38
+ path: path,
39
+ action: action,
40
+ middlewares: middlewares,
41
+ });
42
+ };
44
43
  return Admin;
45
- }(ConduitModule_1.ConduitModule));
44
+ }(classes_1.ConduitModule));
46
45
  exports.Admin = Admin;
47
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,8CAK+B;AAO/B;IAA2B,yBAAqC;IAC9D,eAAqB,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAxE,YACE,kBAAM,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,SAE3C;QAHoB,gBAAU,GAAV,UAAU,CAAQ;QAErC,KAAI,CAAC,gBAAgB,CAAC,sBAAe,CAAC,CAAC;;IACzC,CAAC;IAED,iCAAiB,GAAjB,UACE,UAAkB,EAClB,MAA4E;QAE5E,IAAM,OAAO,GAAyB;YACpC,UAAU,YAAA;YACV,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAA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AC;IACH,YAAC;AAAD,CAAC,AA7BD,CAA2B,uBAAa,GA6BvC;AA7BY,sBAAK"}
@@ -1,5 +1,6 @@
1
- import { ConduitModule } from '../../classes/ConduitModule';
2
- import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest, Empty, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource } from '../../protoUtils/authorization';
1
+ import { ConduitModule } from '../../classes';
2
+ import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource } from '../../protoUtils';
3
+ import { Empty } from '../../protoUtils/google/protobuf/empty';
3
4
  export declare class Authorization extends ConduitModule<typeof AuthorizationDefinition> {
4
5
  private readonly moduleName;
5
6
  constructor(moduleName: string, url: string, grpcToken?: string);
@@ -16,14 +16,14 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Authorization = void 0;
19
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var authorization_1 = require("../../protoUtils/authorization");
19
+ var classes_1 = require("../../classes");
20
+ var protoUtils_1 = require("../../protoUtils");
21
21
  var Authorization = /** @class */ (function (_super) {
22
22
  __extends(Authorization, _super);
23
23
  function Authorization(moduleName, url, grpcToken) {
24
24
  var _this = _super.call(this, moduleName, 'authorization', url, grpcToken) || this;
25
25
  _this.moduleName = moduleName;
26
- _this.initializeClient(authorization_1.AuthorizationDefinition);
26
+ _this.initializeClient(protoUtils_1.AuthorizationDefinition);
27
27
  return _this;
28
28
  }
29
29
  Authorization.prototype.defineResource = function (data) {
@@ -57,6 +57,6 @@ var Authorization = /** @class */ (function (_super) {
57
57
  return this.client.removePermission(data);
58
58
  };
59
59
  return Authorization;
60
- }(ConduitModule_1.ConduitModule));
60
+ }(classes_1.ConduitModule));
61
61
  exports.Authorization = Authorization;
62
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"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