@loopback/example-references-many 6.0.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/.dockerignore +5 -0
- package/.eslintrc.js +8 -0
- package/.prettierignore +2 -0
- package/.prettierrc +7 -0
- package/.vscode/settings.json +20 -0
- package/.vscode/tasks.json +29 -0
- package/CHANGELOG.md +25 -0
- package/Dockerfile +28 -0
- package/LICENSE +25 -0
- package/README.md +49 -0
- package/data/db.json +18 -0
- package/dist/__tests__/acceptance/account.acceptance.d.ts +1 -0
- package/dist/__tests__/acceptance/account.acceptance.js +111 -0
- package/dist/__tests__/acceptance/account.acceptance.js.map +1 -0
- package/dist/__tests__/acceptance/customer.acceptance.d.ts +1 -0
- package/dist/__tests__/acceptance/customer.acceptance.js +163 -0
- package/dist/__tests__/acceptance/customer.acceptance.js.map +1 -0
- package/dist/__tests__/acceptance/home-page.acceptance.d.ts +1 -0
- package/dist/__tests__/acceptance/home-page.acceptance.js +31 -0
- package/dist/__tests__/acceptance/home-page.acceptance.js.map +1 -0
- package/dist/__tests__/acceptance/test-helper.d.ts +7 -0
- package/dist/__tests__/acceptance/test-helper.js +20 -0
- package/dist/__tests__/acceptance/test-helper.js.map +1 -0
- package/dist/__tests__/helpers.d.ts +26 -0
- package/dist/__tests__/helpers.js +101 -0
- package/dist/__tests__/helpers.js.map +1 -0
- package/dist/__tests__/integration/customer.repository.integration.d.ts +1 -0
- package/dist/__tests__/integration/customer.repository.integration.js +61 -0
- package/dist/__tests__/integration/customer.repository.integration.js.map +1 -0
- package/dist/__tests__/unit/controllers/account.controller.unit.d.ts +1 -0
- package/dist/__tests__/unit/controllers/account.controller.unit.js +106 -0
- package/dist/__tests__/unit/controllers/account.controller.unit.js.map +1 -0
- package/dist/__tests__/unit/controllers/customer.controller.unit.d.ts +1 -0
- package/dist/__tests__/unit/controllers/customer.controller.unit.js +108 -0
- package/dist/__tests__/unit/controllers/customer.controller.unit.js.map +1 -0
- package/dist/application.d.ts +272 -0
- package/dist/application.js +41 -0
- package/dist/application.js.map +1 -0
- package/dist/controllers/account.controller.d.ts +15 -0
- package/dist/controllers/account.controller.js +192 -0
- package/dist/controllers/account.controller.js.map +1 -0
- package/dist/controllers/customer.controller.d.ts +15 -0
- package/dist/controllers/customer.controller.js +192 -0
- package/dist/controllers/customer.controller.js.map +1 -0
- package/dist/controllers/index.d.ts +2 -0
- package/dist/controllers/index.js +10 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/datasources/db.datasource.d.ts +12 -0
- package/dist/datasources/db.datasource.js +34 -0
- package/dist/datasources/db.datasource.js.map +1 -0
- package/dist/datasources/index.d.ts +1 -0
- package/dist/datasources/index.js +9 -0
- package/dist/datasources/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/migrate.d.ts +1 -0
- package/dist/migrate.js +25 -0
- package/dist/migrate.js.map +1 -0
- package/dist/models/account.model.d.ts +9 -0
- package/dist/models/account.model.js +35 -0
- package/dist/models/account.model.js.map +1 -0
- package/dist/models/customer.model.d.ts +13 -0
- package/dist/models/customer.model.js +45 -0
- package/dist/models/customer.model.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +10 -0
- package/dist/models/index.js.map +1 -0
- package/dist/openapi-spec.d.ts +1 -0
- package/dist/openapi-spec.js +28 -0
- package/dist/openapi-spec.js.map +1 -0
- package/dist/repositories/account.repository.d.ts +6 -0
- package/dist/repositories/account.repository.js +23 -0
- package/dist/repositories/account.repository.js.map +1 -0
- package/dist/repositories/customer.repository.d.ts +11 -0
- package/dist/repositories/customer.repository.js +29 -0
- package/dist/repositories/customer.repository.js.map +1 -0
- package/dist/repositories/index.d.ts +2 -0
- package/dist/repositories/index.js +10 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/sequence.d.ts +3 -0
- package/dist/sequence.js +12 -0
- package/dist/sequence.js.map +1 -0
- package/package.json +78 -0
- package/public/index.html +72 -0
- package/src/__tests__/acceptance/account.acceptance.ts +139 -0
- package/src/__tests__/acceptance/customer.acceptance.ts +198 -0
- package/src/__tests__/acceptance/home-page.acceptance.ts +36 -0
- package/src/__tests__/acceptance/test-helper.ts +29 -0
- package/src/__tests__/helpers.ts +119 -0
- package/src/__tests__/integration/customer.repository.integration.ts +80 -0
- package/src/__tests__/unit/controllers/account.controller.unit.ts +127 -0
- package/src/__tests__/unit/controllers/customer.controller.unit.ts +136 -0
- package/src/application.ts +49 -0
- package/src/controllers/account.controller.ts +177 -0
- package/src/controllers/customer.controller.ts +177 -0
- package/src/controllers/index.ts +7 -0
- package/src/datasources/db.datasource.ts +34 -0
- package/src/datasources/index.ts +6 -0
- package/src/index.ts +42 -0
- package/src/migrate.ts +25 -0
- package/src/models/account.model.ts +31 -0
- package/src/models/customer.model.ts +40 -0
- package/src/models/index.ts +7 -0
- package/src/openapi-spec.ts +28 -0
- package/src/repositories/account.repository.ts +19 -0
- package/src/repositories/customer.repository.ts +42 -0
- package/src/repositories/index.ts +7 -0
- package/src/sequence.ts +8 -0
- package/tsconfig.json +39 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { ApplicationConfig } from '@loopback/core';
|
|
2
|
+
import { RestApplication } from '@loopback/rest';
|
|
3
|
+
export { ApplicationConfig };
|
|
4
|
+
declare const ReferencesManyApplication_base: (new (...args: any[]) => {
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
bootOptions?: import("@loopback/boot").BootOptions | undefined;
|
|
7
|
+
booted: boolean;
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
boot(): Promise<void>;
|
|
10
|
+
booters(...booterCls: import("@loopback/core").Constructor<import("@loopback/boot").Booter>[]): import("@loopback/boot").Binding<any>[];
|
|
11
|
+
applicationBooter(subApp: import("@loopback/core").Application & import("@loopback/boot").Bootable, filter?: import("@loopback/core").BindingFilter | undefined): import("@loopback/boot").Binding<import("@loopback/boot").Booter>;
|
|
12
|
+
component<C extends import("@loopback/core").Component = import("@loopback/core").Component>(componentCtor: import("@loopback/core").Constructor<C>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding<C>;
|
|
13
|
+
mountComponentBooters(componentInstanceOrClass: import("@loopback/core").Constructor<unknown> | import("@loopback/boot").InstanceWithBooters): void;
|
|
14
|
+
readonly options: ApplicationConfig;
|
|
15
|
+
readonly state: string;
|
|
16
|
+
controller: <T_1>(controllerCtor: import("@loopback/core").ControllerClass<T_1>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_1>;
|
|
17
|
+
server: <T_2 extends import("@loopback/core").Server>(ctor: import("@loopback/core").Constructor<T_2>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_2>;
|
|
18
|
+
servers: <T_3 extends import("@loopback/core").Server>(ctors: import("@loopback/core").Constructor<T_3>[]) => import("@loopback/boot").Binding<any>[];
|
|
19
|
+
getServer: <T_4 extends import("@loopback/core").Server>(target: string | import("@loopback/core").Constructor<T_4>) => Promise<T_4>;
|
|
20
|
+
init: () => Promise<void>;
|
|
21
|
+
onInit: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
22
|
+
onStart: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
23
|
+
stop: () => Promise<void>;
|
|
24
|
+
onStop: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
25
|
+
setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
|
|
26
|
+
lifeCycleObserver: <T_5 extends import("@loopback/core").LifeCycleObserver>(ctor: import("@loopback/core").Constructor<T_5>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_5>;
|
|
27
|
+
service: <S>(cls: import("@loopback/core").ServiceOrProviderClass<S>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding<S>;
|
|
28
|
+
interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor<import("@loopback/core").Provider<import("@loopback/core").Interceptor>>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding<import("@loopback/core").Interceptor>;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
|
|
31
|
+
scope: import("@loopback/core").BindingScope;
|
|
32
|
+
readonly parent: import("@loopback/core").Context | undefined;
|
|
33
|
+
emitEvent: <T_6 extends import("@loopback/core").ContextEvent>(type: string, event: T_6) => void;
|
|
34
|
+
emitError: (err: unknown) => void;
|
|
35
|
+
bind: <ValueType = any>(key: import("@loopback/core").BindingAddress<ValueType>) => import("@loopback/boot").Binding<ValueType>;
|
|
36
|
+
add: (binding: import("@loopback/boot").Binding<unknown>) => import("@loopback/core").Application;
|
|
37
|
+
configure: <ConfigValueType = any>(key?: import("@loopback/core").BindingAddress<unknown> | undefined) => import("@loopback/boot").Binding<ConfigValueType>;
|
|
38
|
+
getConfigAsValueOrPromise: <ConfigValueType_1>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise<ConfigValueType_1 | undefined>;
|
|
39
|
+
getConfig: <ConfigValueType_2>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise<ConfigValueType_2 | undefined>;
|
|
40
|
+
getConfigSync: <ConfigValueType_3>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3 | undefined;
|
|
41
|
+
unbind: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
42
|
+
subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
|
|
43
|
+
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
44
|
+
close: () => void;
|
|
45
|
+
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
46
|
+
createView: <T_7 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_7>;
|
|
47
|
+
contains: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
48
|
+
isBound: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
49
|
+
getOwnerContext: (keyOrBinding: import("@loopback/core").BindingAddress<unknown> | Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
50
|
+
getScopedContext: (scope: import("@loopback/core").BindingScope.APPLICATION | import("@loopback/core").BindingScope.SERVER | import("@loopback/core").BindingScope.REQUEST) => import("@loopback/core").Context | undefined;
|
|
51
|
+
getResolutionContext: (binding: Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
52
|
+
isVisibleTo: (ctx: import("@loopback/core").Context) => boolean;
|
|
53
|
+
find: <ValueType_1 = any>(pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly<import("@loopback/boot").Binding<ValueType_1>>[];
|
|
54
|
+
findByTag: <ValueType_2 = any>(tagFilter: RegExp | import("@loopback/core").BindingTag) => Readonly<import("@loopback/boot").Binding<ValueType_2>>[];
|
|
55
|
+
get: {
|
|
56
|
+
<ValueType_3>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_3>, session?: import("@loopback/core").ResolutionSession | undefined): Promise<ValueType_3>;
|
|
57
|
+
<ValueType_4>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_4>, options: import("@loopback/core").ResolutionOptions): Promise<ValueType_4 | undefined>;
|
|
58
|
+
};
|
|
59
|
+
getSync: {
|
|
60
|
+
<ValueType_5>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_5>, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5;
|
|
61
|
+
<ValueType_6>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_6>, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6 | undefined;
|
|
62
|
+
};
|
|
63
|
+
getBinding: {
|
|
64
|
+
<ValueType_7 = any>(key: import("@loopback/core").BindingAddress<ValueType_7>): import("@loopback/boot").Binding<ValueType_7>;
|
|
65
|
+
<ValueType_8>(key: import("@loopback/core").BindingAddress<ValueType_8>, options?: {
|
|
66
|
+
optional?: boolean | undefined;
|
|
67
|
+
} | undefined): import("@loopback/boot").Binding<ValueType_8> | undefined;
|
|
68
|
+
};
|
|
69
|
+
findOrCreateBinding: <T_8>(key: import("@loopback/core").BindingAddress<T_8>, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding<T_8>;
|
|
70
|
+
getValueOrPromise: <ValueType_9>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_9>, optionsOrSession?: import("@loopback/core").ResolutionOptionsOrSession | undefined) => import("@loopback/core").ValueOrPromise<ValueType_9 | undefined>;
|
|
71
|
+
toJSON: () => import("@loopback/core").JSONObject;
|
|
72
|
+
inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
|
|
73
|
+
on: {
|
|
74
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
75
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
76
|
+
};
|
|
77
|
+
once: {
|
|
78
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
79
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
80
|
+
};
|
|
81
|
+
addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
82
|
+
removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
83
|
+
off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
84
|
+
removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
|
|
85
|
+
setMaxListeners: (n: number) => import("@loopback/core").Application;
|
|
86
|
+
getMaxListeners: () => number;
|
|
87
|
+
listeners: (event: string | symbol) => Function[];
|
|
88
|
+
rawListeners: (event: string | symbol) => Function[];
|
|
89
|
+
emit: (event: string | symbol, ...args: any[]) => boolean;
|
|
90
|
+
listenerCount: (event: string | symbol) => number;
|
|
91
|
+
prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
92
|
+
prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
93
|
+
eventNames: () => (string | symbol)[];
|
|
94
|
+
}) & (new (...args: any[]) => {
|
|
95
|
+
serviceProvider<S_1>(provider: import("@loopback/core").Constructor<import("@loopback/core").Provider<S_1>>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined): import("@loopback/boot").Binding<S_1>;
|
|
96
|
+
component<C_1 extends import("@loopback/core").Component = import("@loopback/core").Component>(componentCtor: import("@loopback/core").Constructor<C_1>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding<C_1>;
|
|
97
|
+
mountComponentServices<C_1 extends import("@loopback/core").Component = import("@loopback/core").Component>(component: import("@loopback/core").Constructor<C_1>, componentBindingKey?: import("@loopback/core").BindingAddress<C_1> | undefined): void;
|
|
98
|
+
readonly options: ApplicationConfig;
|
|
99
|
+
readonly state: string;
|
|
100
|
+
controller: <T_1_1>(controllerCtor: import("@loopback/core").ControllerClass<T_1_1>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_1_1>;
|
|
101
|
+
server: <T_2_1 extends import("@loopback/core").Server>(ctor: import("@loopback/core").Constructor<T_2_1>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_2_1>;
|
|
102
|
+
servers: <T_3_1 extends import("@loopback/core").Server>(ctors: import("@loopback/core").Constructor<T_3_1>[]) => import("@loopback/boot").Binding<any>[];
|
|
103
|
+
getServer: <T_4_1 extends import("@loopback/core").Server>(target: string | import("@loopback/core").Constructor<T_4_1>) => Promise<T_4_1>;
|
|
104
|
+
init: () => Promise<void>;
|
|
105
|
+
onInit: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
106
|
+
start: () => Promise<void>;
|
|
107
|
+
onStart: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
108
|
+
stop: () => Promise<void>;
|
|
109
|
+
onStop: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
110
|
+
setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
|
|
111
|
+
lifeCycleObserver: <T_5_1 extends import("@loopback/core").LifeCycleObserver>(ctor: import("@loopback/core").Constructor<T_5_1>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_5_1>;
|
|
112
|
+
service: <S_1>(cls: import("@loopback/core").ServiceOrProviderClass<S_1>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding<S_1>;
|
|
113
|
+
interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor<import("@loopback/core").Provider<import("@loopback/core").Interceptor>>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding<import("@loopback/core").Interceptor>;
|
|
114
|
+
readonly name: string;
|
|
115
|
+
readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
|
|
116
|
+
scope: import("@loopback/core").BindingScope;
|
|
117
|
+
readonly parent: import("@loopback/core").Context | undefined;
|
|
118
|
+
emitEvent: <T_6_1 extends import("@loopback/core").ContextEvent>(type: string, event: T_6_1) => void;
|
|
119
|
+
emitError: (err: unknown) => void;
|
|
120
|
+
bind: <ValueType_10 = any>(key: import("@loopback/core").BindingAddress<ValueType_10>) => import("@loopback/boot").Binding<ValueType_10>;
|
|
121
|
+
add: (binding: import("@loopback/boot").Binding<unknown>) => import("@loopback/core").Application;
|
|
122
|
+
configure: <ConfigValueType_4 = any>(key?: import("@loopback/core").BindingAddress<unknown> | undefined) => import("@loopback/boot").Binding<ConfigValueType_4>;
|
|
123
|
+
getConfigAsValueOrPromise: <ConfigValueType_1_1>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise<ConfigValueType_1_1 | undefined>;
|
|
124
|
+
getConfig: <ConfigValueType_2_1>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise<ConfigValueType_2_1 | undefined>;
|
|
125
|
+
getConfigSync: <ConfigValueType_3_1>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3_1 | undefined;
|
|
126
|
+
unbind: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
127
|
+
subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
|
|
128
|
+
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
129
|
+
close: () => void;
|
|
130
|
+
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
131
|
+
createView: <T_7_1 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_7_1>;
|
|
132
|
+
contains: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
133
|
+
isBound: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
134
|
+
getOwnerContext: (keyOrBinding: import("@loopback/core").BindingAddress<unknown> | Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
135
|
+
getScopedContext: (scope: import("@loopback/core").BindingScope.APPLICATION | import("@loopback/core").BindingScope.SERVER | import("@loopback/core").BindingScope.REQUEST) => import("@loopback/core").Context | undefined;
|
|
136
|
+
getResolutionContext: (binding: Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
137
|
+
isVisibleTo: (ctx: import("@loopback/core").Context) => boolean;
|
|
138
|
+
find: <ValueType_1_1 = any>(pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly<import("@loopback/boot").Binding<ValueType_1_1>>[];
|
|
139
|
+
findByTag: <ValueType_2_1 = any>(tagFilter: RegExp | import("@loopback/core").BindingTag) => Readonly<import("@loopback/boot").Binding<ValueType_2_1>>[];
|
|
140
|
+
get: {
|
|
141
|
+
<ValueType_3_1>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_3_1>, session?: import("@loopback/core").ResolutionSession | undefined): Promise<ValueType_3_1>;
|
|
142
|
+
<ValueType_4_1>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_4_1>, options: import("@loopback/core").ResolutionOptions): Promise<ValueType_4_1 | undefined>;
|
|
143
|
+
};
|
|
144
|
+
getSync: {
|
|
145
|
+
<ValueType_5_1>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_5_1>, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5_1;
|
|
146
|
+
<ValueType_6_1>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_6_1>, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6_1 | undefined;
|
|
147
|
+
};
|
|
148
|
+
getBinding: {
|
|
149
|
+
<ValueType_7_1 = any>(key: import("@loopback/core").BindingAddress<ValueType_7_1>): import("@loopback/boot").Binding<ValueType_7_1>;
|
|
150
|
+
<ValueType_8_1>(key: import("@loopback/core").BindingAddress<ValueType_8_1>, options?: {
|
|
151
|
+
optional?: boolean | undefined;
|
|
152
|
+
} | undefined): import("@loopback/boot").Binding<ValueType_8_1> | undefined;
|
|
153
|
+
};
|
|
154
|
+
findOrCreateBinding: <T_8_1>(key: import("@loopback/core").BindingAddress<T_8_1>, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding<T_8_1>;
|
|
155
|
+
getValueOrPromise: <ValueType_9_1>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_9_1>, optionsOrSession?: import("@loopback/core").ResolutionOptionsOrSession | undefined) => import("@loopback/core").ValueOrPromise<ValueType_9_1 | undefined>;
|
|
156
|
+
toJSON: () => import("@loopback/core").JSONObject;
|
|
157
|
+
inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
|
|
158
|
+
on: {
|
|
159
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
160
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
161
|
+
};
|
|
162
|
+
once: {
|
|
163
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
164
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
165
|
+
};
|
|
166
|
+
addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
167
|
+
removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
168
|
+
off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
169
|
+
removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
|
|
170
|
+
setMaxListeners: (n: number) => import("@loopback/core").Application;
|
|
171
|
+
getMaxListeners: () => number;
|
|
172
|
+
listeners: (event: string | symbol) => Function[];
|
|
173
|
+
rawListeners: (event: string | symbol) => Function[];
|
|
174
|
+
emit: (event: string | symbol, ...args: any[]) => boolean;
|
|
175
|
+
listenerCount: (event: string | symbol) => number;
|
|
176
|
+
prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
177
|
+
prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
178
|
+
eventNames: () => (string | symbol)[];
|
|
179
|
+
}) & (new (...args: any[]) => {
|
|
180
|
+
repository<R extends import("@loopback/repository").Repository<any>>(repoClass: import("@loopback/repository").Class<R>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding<R>;
|
|
181
|
+
getRepository<R_1 extends import("@loopback/repository").Repository<any>>(repo: import("@loopback/repository").Class<R_1>): Promise<R_1>;
|
|
182
|
+
dataSource<D extends import("@loopback/repository").JugglerDataSource>(dataSource: D | import("@loopback/repository").Class<D>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding<D>;
|
|
183
|
+
model<M extends import("@loopback/repository").Class<unknown>>(modelClass: M): import("@loopback/boot").Binding<M>;
|
|
184
|
+
component<C_2 extends import("@loopback/core").Component = import("@loopback/core").Component>(componentCtor: import("@loopback/core").Constructor<C_2>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined): import("@loopback/boot").Binding<C_2>;
|
|
185
|
+
mountComponentRepositories(componentInstanceOrClass: import("@loopback/repository").RepositoryComponent | import("@loopback/repository").Class<unknown>): void;
|
|
186
|
+
mountComponentModels(component: import("@loopback/repository").RepositoryComponent): void;
|
|
187
|
+
migrateSchema(options?: import("@loopback/repository").SchemaMigrationOptions | undefined): Promise<void>;
|
|
188
|
+
readonly options: ApplicationConfig;
|
|
189
|
+
readonly state: string;
|
|
190
|
+
controller: <T_1_2>(controllerCtor: import("@loopback/core").ControllerClass<T_1_2>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_1_2>;
|
|
191
|
+
server: <T_2_2 extends import("@loopback/core").Server>(ctor: import("@loopback/core").Constructor<T_2_2>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_2_2>;
|
|
192
|
+
servers: <T_3_2 extends import("@loopback/core").Server>(ctors: import("@loopback/core").Constructor<T_3_2>[]) => import("@loopback/boot").Binding<any>[];
|
|
193
|
+
getServer: <T_4_2 extends import("@loopback/core").Server>(target: string | import("@loopback/core").Constructor<T_4_2>) => Promise<T_4_2>;
|
|
194
|
+
init: () => Promise<void>;
|
|
195
|
+
onInit: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
196
|
+
start: () => Promise<void>;
|
|
197
|
+
onStart: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
198
|
+
stop: () => Promise<void>;
|
|
199
|
+
onStop: (fn: () => import("@loopback/core").ValueOrPromise<void>) => import("@loopback/boot").Binding<import("@loopback/core").LifeCycleObserver>;
|
|
200
|
+
setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
|
|
201
|
+
lifeCycleObserver: <T_5_2 extends import("@loopback/core").LifeCycleObserver>(ctor: import("@loopback/core").Constructor<T_5_2>, nameOrOptions?: string | import("@loopback/core").BindingFromClassOptions | undefined) => import("@loopback/boot").Binding<T_5_2>;
|
|
202
|
+
service: <S_2>(cls: import("@loopback/core").ServiceOrProviderClass<S_2>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => import("@loopback/boot").Binding<S_2>;
|
|
203
|
+
interceptor: (interceptor: import("@loopback/core").Interceptor | import("@loopback/core").Constructor<import("@loopback/core").Provider<import("@loopback/core").Interceptor>>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => import("@loopback/boot").Binding<import("@loopback/core").Interceptor>;
|
|
204
|
+
readonly name: string;
|
|
205
|
+
readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
|
|
206
|
+
scope: import("@loopback/core").BindingScope;
|
|
207
|
+
readonly parent: import("@loopback/core").Context | undefined;
|
|
208
|
+
emitEvent: <T_6_2 extends import("@loopback/core").ContextEvent>(type: string, event: T_6_2) => void;
|
|
209
|
+
emitError: (err: unknown) => void;
|
|
210
|
+
bind: <ValueType_11 = any>(key: import("@loopback/core").BindingAddress<ValueType_11>) => import("@loopback/boot").Binding<ValueType_11>;
|
|
211
|
+
add: (binding: import("@loopback/boot").Binding<unknown>) => import("@loopback/core").Application;
|
|
212
|
+
configure: <ConfigValueType_5 = any>(key?: import("@loopback/core").BindingAddress<unknown> | undefined) => import("@loopback/boot").Binding<ConfigValueType_5>;
|
|
213
|
+
getConfigAsValueOrPromise: <ConfigValueType_1_2>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise<ConfigValueType_1_2 | undefined>;
|
|
214
|
+
getConfig: <ConfigValueType_2_2>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise<ConfigValueType_2_2 | undefined>;
|
|
215
|
+
getConfigSync: <ConfigValueType_3_2>(key: import("@loopback/core").BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3_2 | undefined;
|
|
216
|
+
unbind: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
217
|
+
subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
|
|
218
|
+
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
219
|
+
close: () => void;
|
|
220
|
+
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
221
|
+
createView: <T_7_2 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_7_2>;
|
|
222
|
+
contains: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
223
|
+
isBound: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
224
|
+
getOwnerContext: (keyOrBinding: import("@loopback/core").BindingAddress<unknown> | Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
225
|
+
getScopedContext: (scope: import("@loopback/core").BindingScope.APPLICATION | import("@loopback/core").BindingScope.SERVER | import("@loopback/core").BindingScope.REQUEST) => import("@loopback/core").Context | undefined;
|
|
226
|
+
getResolutionContext: (binding: Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
227
|
+
isVisibleTo: (ctx: import("@loopback/core").Context) => boolean;
|
|
228
|
+
find: <ValueType_1_2 = any>(pattern?: string | RegExp | import("@loopback/core").BindingFilter | undefined) => Readonly<import("@loopback/boot").Binding<ValueType_1_2>>[];
|
|
229
|
+
findByTag: <ValueType_2_2 = any>(tagFilter: RegExp | import("@loopback/core").BindingTag) => Readonly<import("@loopback/boot").Binding<ValueType_2_2>>[];
|
|
230
|
+
get: {
|
|
231
|
+
<ValueType_3_2>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_3_2>, session?: import("@loopback/core").ResolutionSession | undefined): Promise<ValueType_3_2>;
|
|
232
|
+
<ValueType_4_2>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_4_2>, options: import("@loopback/core").ResolutionOptions): Promise<ValueType_4_2 | undefined>;
|
|
233
|
+
};
|
|
234
|
+
getSync: {
|
|
235
|
+
<ValueType_5_2>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_5_2>, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5_2;
|
|
236
|
+
<ValueType_6_2>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_6_2>, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6_2 | undefined;
|
|
237
|
+
};
|
|
238
|
+
getBinding: {
|
|
239
|
+
<ValueType_7_2 = any>(key: import("@loopback/core").BindingAddress<ValueType_7_2>): import("@loopback/boot").Binding<ValueType_7_2>;
|
|
240
|
+
<ValueType_8_2>(key: import("@loopback/core").BindingAddress<ValueType_8_2>, options?: {
|
|
241
|
+
optional?: boolean | undefined;
|
|
242
|
+
} | undefined): import("@loopback/boot").Binding<ValueType_8_2> | undefined;
|
|
243
|
+
};
|
|
244
|
+
findOrCreateBinding: <T_8_2>(key: import("@loopback/core").BindingAddress<T_8_2>, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => import("@loopback/boot").Binding<T_8_2>;
|
|
245
|
+
getValueOrPromise: <ValueType_9_2>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_9_2>, optionsOrSession?: import("@loopback/core").ResolutionOptionsOrSession | undefined) => import("@loopback/core").ValueOrPromise<ValueType_9_2 | undefined>;
|
|
246
|
+
toJSON: () => import("@loopback/core").JSONObject;
|
|
247
|
+
inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
|
|
248
|
+
on: {
|
|
249
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
250
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
251
|
+
};
|
|
252
|
+
once: {
|
|
253
|
+
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): import("@loopback/core").Application;
|
|
254
|
+
(event: string | symbol, listener: (...args: any[]) => void): import("@loopback/core").Application;
|
|
255
|
+
};
|
|
256
|
+
addListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
257
|
+
removeListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
258
|
+
off: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
259
|
+
removeAllListeners: (event?: string | symbol | undefined) => import("@loopback/core").Application;
|
|
260
|
+
setMaxListeners: (n: number) => import("@loopback/core").Application;
|
|
261
|
+
getMaxListeners: () => number;
|
|
262
|
+
listeners: (event: string | symbol) => Function[];
|
|
263
|
+
rawListeners: (event: string | symbol) => Function[];
|
|
264
|
+
emit: (event: string | symbol, ...args: any[]) => boolean;
|
|
265
|
+
listenerCount: (event: string | symbol) => number;
|
|
266
|
+
prependListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
267
|
+
prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => import("@loopback/core").Application;
|
|
268
|
+
eventNames: () => (string | symbol)[];
|
|
269
|
+
}) & typeof RestApplication;
|
|
270
|
+
export declare class ReferencesManyApplication extends ReferencesManyApplication_base {
|
|
271
|
+
constructor(options?: ApplicationConfig);
|
|
272
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. and LoopBack contributors 2022. All Rights Reserved.
|
|
3
|
+
// Node module: @loopback/example-references-many
|
|
4
|
+
// This file is licensed under the MIT License.
|
|
5
|
+
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ReferencesManyApplication = void 0;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const boot_1 = require("@loopback/boot");
|
|
10
|
+
const repository_1 = require("@loopback/repository");
|
|
11
|
+
const rest_1 = require("@loopback/rest");
|
|
12
|
+
const rest_explorer_1 = require("@loopback/rest-explorer");
|
|
13
|
+
const service_proxy_1 = require("@loopback/service-proxy");
|
|
14
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
15
|
+
const sequence_1 = require("./sequence");
|
|
16
|
+
class ReferencesManyApplication extends (0, boot_1.BootMixin)((0, service_proxy_1.ServiceMixin)((0, repository_1.RepositoryMixin)(rest_1.RestApplication))) {
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
super(options);
|
|
19
|
+
// Set up the custom sequence
|
|
20
|
+
this.sequence(sequence_1.MySequence);
|
|
21
|
+
// Set up default home page
|
|
22
|
+
this.static('/', path_1.default.join(__dirname, '../public'));
|
|
23
|
+
// Customize @loopback/rest-explorer configuration here
|
|
24
|
+
this.configure(rest_explorer_1.RestExplorerBindings.COMPONENT).to({
|
|
25
|
+
path: '/explorer',
|
|
26
|
+
});
|
|
27
|
+
this.component(rest_explorer_1.RestExplorerComponent);
|
|
28
|
+
this.projectRoot = __dirname;
|
|
29
|
+
// Customize @loopback/boot Booter Conventions here
|
|
30
|
+
this.bootOptions = {
|
|
31
|
+
controllers: {
|
|
32
|
+
// Customize ControllerBooter Conventions here
|
|
33
|
+
dirs: ['controllers'],
|
|
34
|
+
extensions: ['.controller.js'],
|
|
35
|
+
nested: true,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.ReferencesManyApplication = ReferencesManyApplication;
|
|
41
|
+
//# sourceMappingURL=application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,iDAAiD;AACjD,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAAyC;AAEzC,qDAAqD;AACrD,yCAA+C;AAC/C,2DAGiC;AACjC,2DAAqD;AACrD,wDAAwB;AACxB,yCAAsC;AAItC,MAAa,yBAA0B,SAAQ,IAAA,gBAAS,EACtD,IAAA,4BAAY,EAAC,IAAA,4BAAe,EAAC,sBAAe,CAAC,CAAC,CAC/C;IACC,YAAY,UAA6B,EAAE;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,6BAA6B;QAC7B,IAAI,CAAC,QAAQ,CAAC,qBAAU,CAAC,CAAC;QAE1B,2BAA2B;QAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QAEpD,uDAAuD;QACvD,IAAI,CAAC,SAAS,CAAC,oCAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAChD,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,CAAC,qCAAqB,CAAC,CAAC;QAEtC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,mDAAmD;QACnD,IAAI,CAAC,WAAW,GAAG;YACjB,WAAW,EAAE;gBACX,8CAA8C;gBAC9C,IAAI,EAAE,CAAC,aAAa,CAAC;gBACrB,UAAU,EAAE,CAAC,gBAAgB,CAAC;gBAC9B,MAAM,EAAE,IAAI;aACb;SACF,CAAC;IACJ,CAAC;CACF;AA7BD,8DA6BC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Count, Filter, FilterExcludingWhere, Where } from '@loopback/repository';
|
|
2
|
+
import { Account } from '../models';
|
|
3
|
+
import { AccountRepository } from '../repositories';
|
|
4
|
+
export declare class AccountController {
|
|
5
|
+
accountRepository: AccountRepository;
|
|
6
|
+
constructor(accountRepository: AccountRepository);
|
|
7
|
+
create(account: Omit<Account, 'id'>): Promise<Account>;
|
|
8
|
+
count(where?: Where<Account>): Promise<Count>;
|
|
9
|
+
find(filter?: Filter<Account>): Promise<Account[]>;
|
|
10
|
+
updateAll(account: Account, where?: Where<Account>): Promise<Count>;
|
|
11
|
+
findById(id: number, filter?: FilterExcludingWhere<Account>): Promise<Account>;
|
|
12
|
+
updateById(id: number, account: Account): Promise<void>;
|
|
13
|
+
deleteById(id: number): Promise<void>;
|
|
14
|
+
replaceById(id: number, account: Account): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. and LoopBack contributors 2022. All Rights Reserved.
|
|
3
|
+
// Node module: @loopback/example-references-many
|
|
4
|
+
// This file is licensed under the MIT License.
|
|
5
|
+
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AccountController = void 0;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const repository_1 = require("@loopback/repository");
|
|
10
|
+
const rest_1 = require("@loopback/rest");
|
|
11
|
+
const models_1 = require("../models");
|
|
12
|
+
const repositories_1 = require("../repositories");
|
|
13
|
+
let AccountController = class AccountController {
|
|
14
|
+
constructor(accountRepository) {
|
|
15
|
+
this.accountRepository = accountRepository;
|
|
16
|
+
}
|
|
17
|
+
async create(account) {
|
|
18
|
+
return this.accountRepository.create(account);
|
|
19
|
+
}
|
|
20
|
+
async count(where) {
|
|
21
|
+
return this.accountRepository.count(where);
|
|
22
|
+
}
|
|
23
|
+
async find(filter) {
|
|
24
|
+
return this.accountRepository.find(filter);
|
|
25
|
+
}
|
|
26
|
+
async updateAll(account, where) {
|
|
27
|
+
return this.accountRepository.updateAll(account, where);
|
|
28
|
+
}
|
|
29
|
+
async findById(id, filter) {
|
|
30
|
+
return this.accountRepository.findById(id, filter);
|
|
31
|
+
}
|
|
32
|
+
async updateById(id, account) {
|
|
33
|
+
await this.accountRepository.updateById(id, account);
|
|
34
|
+
}
|
|
35
|
+
async deleteById(id) {
|
|
36
|
+
await this.accountRepository.deleteById(id);
|
|
37
|
+
}
|
|
38
|
+
async replaceById(id, account) {
|
|
39
|
+
await this.accountRepository.replaceById(id, account);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, rest_1.post)('/accounts', {
|
|
44
|
+
responses: {
|
|
45
|
+
'200': {
|
|
46
|
+
description: 'Account model instance',
|
|
47
|
+
content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Account) } },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
52
|
+
content: {
|
|
53
|
+
'application/json': {
|
|
54
|
+
schema: (0, rest_1.getModelSchemaRef)(models_1.Account, {
|
|
55
|
+
title: 'NewAccount',
|
|
56
|
+
exclude: ['id'],
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
})),
|
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
|
62
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
64
|
+
], AccountController.prototype, "create", null);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, rest_1.get)('/accounts/count', {
|
|
67
|
+
responses: {
|
|
68
|
+
'200': {
|
|
69
|
+
description: 'Account model count',
|
|
70
|
+
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
tslib_1.__param(0, rest_1.param.where(models_1.Account)),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
|
+
], AccountController.prototype, "count", null);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, rest_1.get)('/accounts', {
|
|
81
|
+
responses: {
|
|
82
|
+
'200': {
|
|
83
|
+
description: 'Array of Account model instances',
|
|
84
|
+
content: {
|
|
85
|
+
'application/json': {
|
|
86
|
+
schema: {
|
|
87
|
+
type: 'array',
|
|
88
|
+
items: (0, rest_1.getModelSchemaRef)(models_1.Account, { includeRelations: true }),
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
tslib_1.__param(0, rest_1.param.filter(models_1.Account)),
|
|
96
|
+
tslib_1.__metadata("design:type", Function),
|
|
97
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
98
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
99
|
+
], AccountController.prototype, "find", null);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, rest_1.patch)('/accounts', {
|
|
102
|
+
responses: {
|
|
103
|
+
'200': {
|
|
104
|
+
description: 'Account PATCH success count',
|
|
105
|
+
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
110
|
+
content: {
|
|
111
|
+
'application/json': {
|
|
112
|
+
schema: (0, rest_1.getModelSchemaRef)(models_1.Account, { partial: true }),
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
})),
|
|
116
|
+
tslib_1.__param(1, rest_1.param.where(models_1.Account)),
|
|
117
|
+
tslib_1.__metadata("design:type", Function),
|
|
118
|
+
tslib_1.__metadata("design:paramtypes", [models_1.Account, Object]),
|
|
119
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
120
|
+
], AccountController.prototype, "updateAll", null);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
(0, rest_1.get)('/accounts/{id}', {
|
|
123
|
+
responses: {
|
|
124
|
+
'200': {
|
|
125
|
+
description: 'Account model instance',
|
|
126
|
+
content: {
|
|
127
|
+
'application/json': {
|
|
128
|
+
schema: (0, rest_1.getModelSchemaRef)(models_1.Account, { includeRelations: true }),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
}),
|
|
134
|
+
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
135
|
+
tslib_1.__param(1, rest_1.param.filter(models_1.Account, { exclude: 'where' })),
|
|
136
|
+
tslib_1.__metadata("design:type", Function),
|
|
137
|
+
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
138
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
139
|
+
], AccountController.prototype, "findById", null);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, rest_1.patch)('/accounts/{id}', {
|
|
142
|
+
responses: {
|
|
143
|
+
'204': {
|
|
144
|
+
description: 'Account PATCH success',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
149
|
+
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
150
|
+
content: {
|
|
151
|
+
'application/json': {
|
|
152
|
+
schema: (0, rest_1.getModelSchemaRef)(models_1.Account, { partial: true }),
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
})),
|
|
156
|
+
tslib_1.__metadata("design:type", Function),
|
|
157
|
+
tslib_1.__metadata("design:paramtypes", [Number, models_1.Account]),
|
|
158
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
159
|
+
], AccountController.prototype, "updateById", null);
|
|
160
|
+
tslib_1.__decorate([
|
|
161
|
+
(0, rest_1.del)('/accounts/{id}', {
|
|
162
|
+
responses: {
|
|
163
|
+
'204': {
|
|
164
|
+
description: 'Account DELETE success',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}),
|
|
168
|
+
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
169
|
+
tslib_1.__metadata("design:type", Function),
|
|
170
|
+
tslib_1.__metadata("design:paramtypes", [Number]),
|
|
171
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
172
|
+
], AccountController.prototype, "deleteById", null);
|
|
173
|
+
tslib_1.__decorate([
|
|
174
|
+
(0, rest_1.put)('/accounts/{id}', {
|
|
175
|
+
responses: {
|
|
176
|
+
'204': {
|
|
177
|
+
description: 'Account PUT success',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
}),
|
|
181
|
+
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
182
|
+
tslib_1.__param(1, (0, rest_1.requestBody)()),
|
|
183
|
+
tslib_1.__metadata("design:type", Function),
|
|
184
|
+
tslib_1.__metadata("design:paramtypes", [Number, models_1.Account]),
|
|
185
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
186
|
+
], AccountController.prototype, "replaceById", null);
|
|
187
|
+
AccountController = tslib_1.__decorate([
|
|
188
|
+
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.AccountRepository)),
|
|
189
|
+
tslib_1.__metadata("design:paramtypes", [repositories_1.AccountRepository])
|
|
190
|
+
], AccountController);
|
|
191
|
+
exports.AccountController = AccountController;
|
|
192
|
+
//# sourceMappingURL=account.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.controller.js","sourceRoot":"","sources":["../../src/controllers/account.controller.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,iDAAiD;AACjD,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,qDAO8B;AAC9B,yCASwB;AACxB,sCAAkC;AAClC,kDAAkD;AAElD,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC5B,YAES,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAC1C,CAAC;IAUJ,KAAK,CAAC,MAAM,CAWV,OAA4B;QAE5B,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAUD,KAAK,CAAC,KAAK,CAAuB,KAAsB;QACtD,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAiBD,KAAK,CAAC,IAAI,CACe,MAAwB;QAE/C,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAUD,KAAK,CAAC,SAAS,CAQb,OAAgB,EACM,KAAsB;QAE5C,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|
|
|
1
|
+
import { Count, Filter, FilterExcludingWhere, Where } from '@loopback/repository';
|
|
2
|
+
import { Customer } from '../models';
|
|
3
|
+
import { CustomerRepository } from '../repositories';
|
|
4
|
+
export declare class CustomerController {
|
|
5
|
+
customerRepository: CustomerRepository;
|
|
6
|
+
constructor(customerRepository: CustomerRepository);
|
|
7
|
+
create(customer: Omit<Customer, 'id'>): Promise<Customer>;
|
|
8
|
+
count(where?: Where<Customer>): Promise<Count>;
|
|
9
|
+
find(filter?: Filter<Customer>): Promise<Customer[]>;
|
|
10
|
+
updateAll(customer: Customer, where?: Where<Customer>): Promise<Count>;
|
|
11
|
+
findById(id: number, filter?: FilterExcludingWhere<Customer>): Promise<Customer>;
|
|
12
|
+
updateById(id: number, customer: Customer): Promise<void>;
|
|
13
|
+
deleteById(id: number): Promise<void>;
|
|
14
|
+
replaceById(id: number, customer: Customer): Promise<void>;
|
|
15
|
+
}
|