entropic-bond 1.48.1 → 1.50.0

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 (141) hide show
  1. package/.github/workflows/release.yml +26 -0
  2. package/CHANGELOG.md +1151 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/README.md +94 -0
  5. package/docs/classes/Auth.md +391 -0
  6. package/docs/classes/AuthMock.md +278 -0
  7. package/docs/classes/AuthService.md +188 -0
  8. package/docs/classes/CloudFunctions.md +123 -0
  9. package/docs/classes/CloudFunctionsMock.md +97 -0
  10. package/docs/classes/CloudStorage.md +215 -0
  11. package/docs/classes/DataSource.md +248 -0
  12. package/docs/classes/EntropicComponent.md +666 -0
  13. package/docs/classes/JsonDataSource.md +328 -0
  14. package/docs/classes/MockCloudStorage.md +279 -0
  15. package/docs/classes/Model.md +274 -0
  16. package/docs/classes/Observable.md +120 -0
  17. package/docs/classes/Persistent.md +420 -0
  18. package/docs/classes/ServerAuth.md +211 -0
  19. package/docs/classes/ServerAuthMock.md +176 -0
  20. package/docs/classes/ServerAuthService.md +130 -0
  21. package/docs/classes/Store.md +218 -0
  22. package/docs/classes/StoredFile.md +636 -0
  23. package/docs/enums/StoredFileEvent.md +41 -0
  24. package/docs/interfaces/AuthError.md +30 -0
  25. package/docs/interfaces/CloudFunctionsService.md +69 -0
  26. package/docs/interfaces/Collection.md +13 -0
  27. package/docs/interfaces/CustomCredentials.md +7 -0
  28. package/docs/interfaces/DocumentReference.md +49 -0
  29. package/docs/interfaces/JsonRawData.md +7 -0
  30. package/docs/interfaces/SignData.md +63 -0
  31. package/docs/interfaces/StoreParams.md +52 -0
  32. package/docs/interfaces/StoredFileChange.md +41 -0
  33. package/docs/interfaces/UploadControl.md +90 -0
  34. package/docs/interfaces/UserCredentials.md +113 -0
  35. package/docs/interfaces/Values.md +17 -0
  36. package/docs/modules.md +1273 -0
  37. package/package.json +23 -19
  38. package/src/auth/auth-mock.spec.ts +168 -0
  39. package/src/auth/auth-mock.ts +129 -0
  40. package/src/auth/auth.ts +185 -0
  41. package/src/auth/user-auth-types.ts +21 -0
  42. package/src/cloud-functions/cloud-functions-mock.spec.ts +136 -0
  43. package/src/cloud-functions/cloud-functions-mock.ts +23 -0
  44. package/src/cloud-functions/cloud-functions.ts +83 -0
  45. package/src/cloud-storage/cloud-storage.spec.ts +207 -0
  46. package/src/cloud-storage/cloud-storage.ts +60 -0
  47. package/src/cloud-storage/mock-cloud-storage.ts +72 -0
  48. package/src/cloud-storage/stored-file.ts +102 -0
  49. package/src/index.ts +19 -0
  50. package/src/observable/observable.spec.ts +105 -0
  51. package/src/observable/observable.ts +67 -0
  52. package/src/persistent/entropic-component.spec.ts +143 -0
  53. package/src/persistent/entropic-component.ts +135 -0
  54. package/src/persistent/persistent.spec.ts +828 -0
  55. package/src/persistent/persistent.ts +650 -0
  56. package/src/server-auth/server-auth-mock.spec.ts +53 -0
  57. package/src/server-auth/server-auth-mock.ts +45 -0
  58. package/src/server-auth/server-auth.ts +49 -0
  59. package/src/store/data-source.ts +186 -0
  60. package/src/store/json-data-source.spec.ts +100 -0
  61. package/src/store/json-data-source.ts +256 -0
  62. package/src/store/mocks/mock-data.json +155 -0
  63. package/src/store/mocks/test-user.ts +122 -0
  64. package/src/store/model.spec.ts +659 -0
  65. package/src/store/model.ts +462 -0
  66. package/src/store/store.spec.ts +30 -0
  67. package/src/store/store.ts +113 -0
  68. package/src/types/utility-types.spec.ts +117 -0
  69. package/src/types/utility-types.ts +116 -0
  70. package/src/utils/test-utils/test-person.ts +44 -0
  71. package/src/utils/utils.spec.ts +95 -0
  72. package/{lib/utils/utils.d.ts → src/utils/utils.ts} +34 -10
  73. package/tsconfig-build.json +7 -0
  74. package/tsconfig-cjs.json +9 -0
  75. package/tsconfig.json +33 -0
  76. package/vite.config.ts +22 -0
  77. package/lib/auth/auth-mock.d.ts +0 -21
  78. package/lib/auth/auth-mock.js +0 -108
  79. package/lib/auth/auth-mock.js.map +0 -1
  80. package/lib/auth/auth.d.ts +0 -129
  81. package/lib/auth/auth.js +0 -146
  82. package/lib/auth/auth.js.map +0 -1
  83. package/lib/auth/user-auth-types.d.ts +0 -19
  84. package/lib/auth/user-auth-types.js +0 -3
  85. package/lib/auth/user-auth-types.js.map +0 -1
  86. package/lib/cloud-functions/cloud-functions-mock.d.ts +0 -11
  87. package/lib/cloud-functions/cloud-functions-mock.js +0 -19
  88. package/lib/cloud-functions/cloud-functions-mock.js.map +0 -1
  89. package/lib/cloud-functions/cloud-functions.d.ts +0 -19
  90. package/lib/cloud-functions/cloud-functions.js +0 -64
  91. package/lib/cloud-functions/cloud-functions.js.map +0 -1
  92. package/lib/cloud-storage/cloud-storage.d.ts +0 -24
  93. package/lib/cloud-storage/cloud-storage.js +0 -37
  94. package/lib/cloud-storage/cloud-storage.js.map +0 -1
  95. package/lib/cloud-storage/mock-cloud-storage.d.ts +0 -20
  96. package/lib/cloud-storage/mock-cloud-storage.js +0 -68
  97. package/lib/cloud-storage/mock-cloud-storage.js.map +0 -1
  98. package/lib/cloud-storage/stored-file.d.ts +0 -39
  99. package/lib/cloud-storage/stored-file.js +0 -106
  100. package/lib/cloud-storage/stored-file.js.map +0 -1
  101. package/lib/index.d.ts +0 -19
  102. package/lib/index.js +0 -36
  103. package/lib/index.js.map +0 -1
  104. package/lib/observable/observable.d.ts +0 -52
  105. package/lib/observable/observable.js +0 -66
  106. package/lib/observable/observable.js.map +0 -1
  107. package/lib/persistent/entropic-component.d.ts +0 -76
  108. package/lib/persistent/entropic-component.js +0 -109
  109. package/lib/persistent/entropic-component.js.map +0 -1
  110. package/lib/persistent/persistent.d.ts +0 -281
  111. package/lib/persistent/persistent.js +0 -539
  112. package/lib/persistent/persistent.js.map +0 -1
  113. package/lib/server-auth/server-auth-mock.d.ts +0 -12
  114. package/lib/server-auth/server-auth-mock.js +0 -39
  115. package/lib/server-auth/server-auth-mock.js.map +0 -1
  116. package/lib/server-auth/server-auth.d.ts +0 -24
  117. package/lib/server-auth/server-auth.js +0 -36
  118. package/lib/server-auth/server-auth.js.map +0 -1
  119. package/lib/store/data-source.d.ts +0 -137
  120. package/lib/store/data-source.js +0 -62
  121. package/lib/store/data-source.js.map +0 -1
  122. package/lib/store/json-data-source.d.ts +0 -68
  123. package/lib/store/json-data-source.js +0 -199
  124. package/lib/store/json-data-source.js.map +0 -1
  125. package/lib/store/mocks/test-user.d.ts +0 -49
  126. package/lib/store/mocks/test-user.js +0 -135
  127. package/lib/store/mocks/test-user.js.map +0 -1
  128. package/lib/store/model.d.ts +0 -238
  129. package/lib/store/model.js +0 -417
  130. package/lib/store/model.js.map +0 -1
  131. package/lib/store/store.d.ts +0 -62
  132. package/lib/store/store.js +0 -102
  133. package/lib/store/store.js.map +0 -1
  134. package/lib/types/utility-types.d.ts +0 -45
  135. package/lib/types/utility-types.js +0 -3
  136. package/lib/types/utility-types.js.map +0 -1
  137. package/lib/utils/test-utils/test-person.d.ts +0 -33
  138. package/lib/utils/test-utils/test-person.js +0 -25
  139. package/lib/utils/test-utils/test-person.js.map +0 -1
  140. package/lib/utils/utils.js +0 -76
  141. package/lib/utils/utils.js.map +0 -1
@@ -1,129 +0,0 @@
1
- import { AuthProvider, SignData, UserCredentials } from "./user-auth-types";
2
- /**
3
- * The AuthService class is an abstract class that defines the interface of an authentication service.
4
- * You should derive from this class to implement your own authentication service.
5
- */
6
- export declare abstract class AuthService {
7
- abstract signUp<T extends {}>(signData: SignData): Promise<UserCredentials<T>>;
8
- abstract login<T extends {}>(signData: SignData): Promise<UserCredentials<T>>;
9
- abstract logout(): Promise<void>;
10
- abstract resetEmailPassword(email: string): Promise<void>;
11
- abstract linkAdditionalProvider(provider: AuthProvider): Promise<unknown>;
12
- abstract unlinkProvider(provider: AuthProvider): Promise<unknown>;
13
- abstract onAuthStateChange<T extends {}>(onChange: (userCredentials: UserCredentials<T> | undefined) => void): void;
14
- abstract resendVerificationEmail(email: string, password: string, verificationLink: string): Promise<void>;
15
- }
16
- export type AuthErrorCode = 'wrongPassword' | 'popupClosedByUser' | 'userNotFound' | 'invalidEmail' | 'missingPassword' | 'missingEmail';
17
- export interface AuthError {
18
- code: AuthErrorCode;
19
- message: string;
20
- }
21
- /**
22
- * Types the callback to accept a user credentials object
23
- */
24
- export type ResovedCallback<T extends {}> = (credentials: UserCredentials<T>) => void;
25
- export type RejectedCallback = (reason: AuthError) => void;
26
- /**
27
- * The Auth class is a singleton that provides a unified interface to the authentication service.
28
- * You should register an authentication service by using `Auth.useAuthService`
29
- * method before using the Auth class.
30
- */
31
- export declare class Auth extends AuthService {
32
- static error: {
33
- shouldBeRegistered: string;
34
- };
35
- protected constructor();
36
- /**
37
- * Registers an authentication service to be used by the Auth class.
38
- * You need to register an authentication service before using the Auth class.
39
- * @param authService the authentication service to be used by the Auth class
40
- */
41
- static useAuthService(authService: AuthService): void;
42
- /**
43
- * The instance of the Auth class
44
- * @returns the authentication service
45
- */
46
- static get instance(): Auth;
47
- /**
48
- * Signs up a new user
49
- * @param singData the data to be used to sign up the user
50
- * @returns a promise that resolves to the user credentials
51
- * @example
52
- * // Sign up a new user with email and password
53
- * Auth.instance.signUp({ authProvider: 'email', email: 'john@test.com', password: '123456' })
54
- * // Sign up a new user with a Google account
55
- * Auth.instance.signUp({ authProvider: 'google'})
56
- */
57
- signUp<T extends {}>(singData: SignData): Promise<UserCredentials<T>>;
58
- /**
59
- * Logs in an existing user
60
- * @param singData the data to be used to log in the user
61
- * @returns a promise that resolves to the user credentials
62
- * @example
63
- * // Log in an existing user with email and password
64
- * Auth.instance.login({ authProvider: 'email', email: 'john@test.com', password: '123456' })
65
- * // Log in an existing user with a Google account
66
- * Auth.instance.login({ authProvider: 'google'})
67
- */
68
- login<T extends {}>(singData: SignData): Promise<UserCredentials<T>>;
69
- /**
70
- * Logs out the current user
71
- * @returns a promise that resolves when the user is logged out
72
- */
73
- logout(): Promise<void>;
74
- /**
75
- * Resets the password associated with the email.
76
- * @param email the email address of the user to reset the password
77
- * @returns a promise that resolves when the process is done
78
- */
79
- resetEmailPassword(email: string): Promise<void>;
80
- /**
81
- * Resends the email verification to the user.
82
- * @returns a promise that resolves when the process is done
83
- */
84
- resendVerificationEmail(email: string, password: string, verificationLink: string): Promise<void>;
85
- /**
86
- * Adds a listener to be called when the authentication state changes.
87
- * @param onChange the listener to be called when the authentication state changes.
88
- * The listener is called with the user credentials as a parameter.
89
- * If the user is logged out, the listener is called with `undefined` as a parameter.
90
- * @returns a function to remove the listener
91
- * @example
92
- * // Add a listener to be called when the authentication state changes
93
- * const removeListener = Auth.instance.onAuthStateChange( userCredentials => {
94
- * if ( userCredentials ) {
95
- * // The user is logged in
96
- * } else {
97
- * // The user is logged out
98
- * }
99
- * })
100
- */
101
- onAuthStateChange<T extends {}>(onChange: (userCredentials: UserCredentials<T>) => void): import("../observable/observable").Unsubscriber;
102
- /**
103
- * Removes a listener that was added by `onAuthStateChange` method.
104
- * @param onChange the listener to be removed
105
- */
106
- removeAuthStateChange<T extends {}>(onChange: (userCredentials: UserCredentials<T>) => void): void;
107
- /**
108
- * Links an additional authentication provider to the authenticated user.
109
- * @param provider the provider to be linked
110
- * @returns a promise that resolves when the process is done
111
- * @example
112
- * // Link a Google account to the auth service
113
- * Auth.instance.linkAdditionalProvider({ authProvider: 'google' })
114
- */
115
- linkAdditionalProvider(provider: AuthProvider): Promise<unknown>;
116
- /**
117
- * Unlinks an authentication provider from the authenticated user.
118
- * @param provider the provider to be unlinked
119
- * @returns a promise that resolves when the process is done
120
- * @example
121
- * // Unlink the Google account from the auth service
122
- * Auth.instance.unlinkProvider({ authProvider: 'google' })
123
- */
124
- unlinkProvider(provider: AuthProvider): Promise<unknown>;
125
- private authStateChanged;
126
- private static _instance;
127
- private static _authService;
128
- private _onAuthStateChange;
129
- }
package/lib/auth/auth.js DELETED
@@ -1,146 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Auth = exports.AuthService = void 0;
4
- const observable_1 = require("../observable/observable");
5
- /**
6
- * The AuthService class is an abstract class that defines the interface of an authentication service.
7
- * You should derive from this class to implement your own authentication service.
8
- */
9
- class AuthService {
10
- }
11
- exports.AuthService = AuthService;
12
- /**
13
- * The Auth class is a singleton that provides a unified interface to the authentication service.
14
- * You should register an authentication service by using `Auth.useAuthService`
15
- * method before using the Auth class.
16
- */
17
- class Auth extends AuthService {
18
- constructor() {
19
- super();
20
- this._onAuthStateChange = new observable_1.Observable();
21
- if (!Auth._authService)
22
- throw (new Error(Auth.error.shouldBeRegistered));
23
- Auth._authService.onAuthStateChange(userCredentials => this.authStateChanged(userCredentials));
24
- }
25
- /**
26
- * Registers an authentication service to be used by the Auth class.
27
- * You need to register an authentication service before using the Auth class.
28
- * @param authService the authentication service to be used by the Auth class
29
- */
30
- static useAuthService(authService) {
31
- if (Auth._authService != authService) {
32
- Auth._authService = authService;
33
- this._instance = undefined;
34
- }
35
- }
36
- /**
37
- * The instance of the Auth class
38
- * @returns the authentication service
39
- */
40
- static get instance() {
41
- return this._instance || (this._instance = new this());
42
- }
43
- /**
44
- * Signs up a new user
45
- * @param singData the data to be used to sign up the user
46
- * @returns a promise that resolves to the user credentials
47
- * @example
48
- * // Sign up a new user with email and password
49
- * Auth.instance.signUp({ authProvider: 'email', email: 'john@test.com', password: '123456' })
50
- * // Sign up a new user with a Google account
51
- * Auth.instance.signUp({ authProvider: 'google'})
52
- */
53
- signUp(singData) {
54
- return Auth._authService.signUp(singData);
55
- }
56
- /**
57
- * Logs in an existing user
58
- * @param singData the data to be used to log in the user
59
- * @returns a promise that resolves to the user credentials
60
- * @example
61
- * // Log in an existing user with email and password
62
- * Auth.instance.login({ authProvider: 'email', email: 'john@test.com', password: '123456' })
63
- * // Log in an existing user with a Google account
64
- * Auth.instance.login({ authProvider: 'google'})
65
- */
66
- login(singData) {
67
- return Auth._authService.login(singData);
68
- }
69
- /**
70
- * Logs out the current user
71
- * @returns a promise that resolves when the user is logged out
72
- */
73
- logout() {
74
- return Auth._authService.logout();
75
- }
76
- /**
77
- * Resets the password associated with the email.
78
- * @param email the email address of the user to reset the password
79
- * @returns a promise that resolves when the process is done
80
- */
81
- resetEmailPassword(email) {
82
- return Auth._authService.resetEmailPassword(email);
83
- }
84
- /**
85
- * Resends the email verification to the user.
86
- * @returns a promise that resolves when the process is done
87
- */
88
- resendVerificationEmail(email, password, verificationLink) {
89
- return Auth._authService.resendVerificationEmail(email, password, verificationLink);
90
- }
91
- /**
92
- * Adds a listener to be called when the authentication state changes.
93
- * @param onChange the listener to be called when the authentication state changes.
94
- * The listener is called with the user credentials as a parameter.
95
- * If the user is logged out, the listener is called with `undefined` as a parameter.
96
- * @returns a function to remove the listener
97
- * @example
98
- * // Add a listener to be called when the authentication state changes
99
- * const removeListener = Auth.instance.onAuthStateChange( userCredentials => {
100
- * if ( userCredentials ) {
101
- * // The user is logged in
102
- * } else {
103
- * // The user is logged out
104
- * }
105
- * })
106
- */
107
- onAuthStateChange(onChange) {
108
- return this._onAuthStateChange.subscribe(onChange);
109
- }
110
- /**
111
- * Removes a listener that was added by `onAuthStateChange` method.
112
- * @param onChange the listener to be removed
113
- */
114
- removeAuthStateChange(onChange) {
115
- this._onAuthStateChange.unsubscribe(onChange);
116
- }
117
- /**
118
- * Links an additional authentication provider to the authenticated user.
119
- * @param provider the provider to be linked
120
- * @returns a promise that resolves when the process is done
121
- * @example
122
- * // Link a Google account to the auth service
123
- * Auth.instance.linkAdditionalProvider({ authProvider: 'google' })
124
- */
125
- linkAdditionalProvider(provider) {
126
- return Auth._authService.linkAdditionalProvider(provider);
127
- }
128
- /**
129
- * Unlinks an authentication provider from the authenticated user.
130
- * @param provider the provider to be unlinked
131
- * @returns a promise that resolves when the process is done
132
- * @example
133
- * // Unlink the Google account from the auth service
134
- * Auth.instance.unlinkProvider({ authProvider: 'google' })
135
- */
136
- unlinkProvider(provider) {
137
- return Auth._authService.unlinkProvider(provider);
138
- }
139
- authStateChanged(userCredentials) {
140
- this._onAuthStateChange.notify(userCredentials);
141
- }
142
- }
143
- exports.Auth = Auth;
144
- Auth.error = { shouldBeRegistered: 'You should register an auth service before using Auth.' };
145
- Auth._instance = undefined;
146
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth/auth.ts"],"names":[],"mappings":";;;AAAA,yDAAqD;AAGrD;;;GAGG;AACH,MAAsB,WAAW;CAShC;AATD,kCASC;AAeD;;;;GAIG;AACH,MAAa,IAAK,SAAQ,WAAW;IAGpC;QACC,KAAK,EAAE,CAAA;QA0IA,uBAAkB,GAAoC,IAAI,uBAAU,EAAuB,CAAA;QAzIlG,IAAI,CAAC,IAAI,CAAC,YAAY;YAAG,MAAM,CAAE,IAAI,KAAK,CAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAE,CAAE,CAAA;QAC7E,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAClC,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAE,eAAe,CAAE,CAC3D,CAAA;IACF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAE,WAAwB;QAC9C,IAAK,IAAI,CAAC,YAAY,IAAI,WAAW,EAAG;YACvC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;YAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;SAC1B;IACF,CAAC;IAED;;;OAGG;IACH,MAAM,KAAK,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAE,CAAA;IACxD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAgB,QAAkB;QACvC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAE,QAAQ,CAAE,CAAA;IAC5C,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAgB,QAAkB;QACtC,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAE,QAAQ,CAAE,CAAA;IAC3C,C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ber?: string;
7
- emailVerified?: boolean;
8
- customData?: T;
9
- lastLogin?: number;
10
- creationDate?: number;
11
- }
12
- export type AuthProvider = 'email' | 'facebook' | 'google' | 'twitter';
13
- export interface SignData {
14
- authProvider: AuthProvider;
15
- email?: string;
16
- password?: string;
17
- name?: string;
18
- verificationLink?: string;
19
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=user-auth-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-auth-types.js","sourceRoot":"","sources":["../../src/auth/user-auth-types.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { CloudFunction, CloudFunctionsService } from './cloud-functions';
2
- interface FunctionCollection {
3
- [key: string]: CloudFunction<any, any>;
4
- }
5
- export declare class CloudFunctionsMock implements CloudFunctionsService {
6
- constructor(registeredFunctions: FunctionCollection);
7
- retrieveFunction<P, R>(cloudFunction: string): CloudFunction<P, R>;
8
- callFunction<P, R>(func: CloudFunction<P, R>, params: P): Promise<R>;
9
- private _registeredFunctions;
10
- }
11
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudFunctionsMock = void 0;
4
- class CloudFunctionsMock {
5
- constructor(registeredFunctions) {
6
- this._registeredFunctions = registeredFunctions;
7
- }
8
- retrieveFunction(cloudFunction) {
9
- const func = this._registeredFunctions[cloudFunction];
10
- if (!func)
11
- throw new Error(`Cloud function ${cloudFunction} is not registered.`);
12
- return func;
13
- }
14
- callFunction(func, params) {
15
- return func(params);
16
- }
17
- }
18
- exports.CloudFunctionsMock = CloudFunctionsMock;
19
- //# sourceMappingURL=cloud-functions-mock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloud-functions-mock.js","sourceRoot":"","sources":["../../src/cloud-functions/cloud-functions-mock.ts"],"names":[],"mappings":";;;AAMA,MAAa,kBAAkB;IAC9B,YAAa,mBAAuC;QACnD,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAA;IAChD,CAAC;IAED,gBAAgB,CAAQ,aAAqB;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAE,aAAa,CAAE,CAAA;QACvD,IAAK,CAAC,IAAI;YAAG,MAAM,IAAI,KAAK,CAAE,kBAAmB,aAAc,qBAAqB,CAAE,CAAA;QACtF,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,YAAY,CAAQ,IAAyB,EAAE,MAAS;QACvD,OAAO,IAAI,CAAE,MAAM,CAAE,CAAA;IACtB,CAAC;CAGD;AAhBD,gDAgBC"}
@@ -1,19 +0,0 @@
1
- export type CloudFunction<P, R> = (param?: P) => Promise<R>;
2
- export interface CloudFunctionsService {
3
- retrieveFunction<P, R>(cloudFunction: string): CloudFunction<P, R>;
4
- callFunction<P, R>(func: CloudFunction<P, R>, params: P): Promise<R>;
5
- }
6
- export declare class CloudFunctions {
7
- private constructor();
8
- static error: {
9
- shouldBeRegistered: string;
10
- };
11
- static useCloudFunctionsService(cloudFunctionsService: CloudFunctionsService): void;
12
- static get instance(): CloudFunctions;
13
- getRawFunction<P, R>(cloudFunction: string): CloudFunction<P, R>;
14
- getFunction<P, R = void>(cloudFunction: string): CloudFunction<P, R>;
15
- private processParam;
16
- private processResult;
17
- private static _cloudFunctionsService;
18
- private static _instance;
19
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudFunctions = void 0;
4
- const persistent_1 = require("../persistent/persistent");
5
- class CloudFunctions {
6
- constructor() { }
7
- static useCloudFunctionsService(cloudFunctionsService) {
8
- if (this._cloudFunctionsService != cloudFunctionsService) {
9
- this._cloudFunctionsService = cloudFunctionsService;
10
- }
11
- }
12
- static get instance() {
13
- if (!this._cloudFunctionsService)
14
- throw new Error(CloudFunctions.error.shouldBeRegistered);
15
- return CloudFunctions._instance || (CloudFunctions._instance = new CloudFunctions());
16
- }
17
- getRawFunction(cloudFunction) {
18
- return CloudFunctions._cloudFunctionsService.retrieveFunction(cloudFunction);
19
- }
20
- getFunction(cloudFunction) {
21
- const callFunction = CloudFunctions._cloudFunctionsService.callFunction;
22
- const func = this.getRawFunction(cloudFunction);
23
- return async (param) => {
24
- const result = await callFunction(func, this.processParam(param));
25
- return this.processResult(result);
26
- };
27
- }
28
- processParam(param) {
29
- if (param === undefined || param === null)
30
- return undefined;
31
- if (param instanceof persistent_1.Persistent)
32
- return param.toObject();
33
- if (Array.isArray(param)) {
34
- return param.map(p => this.processParam(p));
35
- }
36
- if (typeof param === 'object') {
37
- return Object.entries(param).reduce((newParam, [key, value]) => {
38
- newParam[key] = this.processParam(value);
39
- return newParam;
40
- }, {});
41
- }
42
- return param;
43
- }
44
- processResult(value) {
45
- if (value === undefined || value === null)
46
- return undefined;
47
- if (value.__className) {
48
- return persistent_1.Persistent.createInstance(value);
49
- }
50
- if (Array.isArray(value)) {
51
- return value.map(elem => this.processResult(elem));
52
- }
53
- if (typeof value === 'object') {
54
- return Object.entries(value).reduce((newVal, [key, val]) => {
55
- newVal[key] = this.processResult(val);
56
- return newVal;
57
- }, {});
58
- }
59
- return value;
60
- }
61
- }
62
- exports.CloudFunctions = CloudFunctions;
63
- CloudFunctions.error = { shouldBeRegistered: 'You should register a cloud functions service with useCloudFunctionsService static method before using CloudFunctions.' };
64
- //# sourceMappingURL=cloud-functions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloud-functions.js","sourceRoot":"","sources":["../../src/cloud-functions/cloud-functions.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAUvE,MAAa,cAAc;IAC1B,gBAAuB,CAAC;IAIxB,MAAM,CAAC,wBAAwB,CAAE,qBAA4C;QAC5E,IAAK,IAAI,CAAC,sBAAsB,IAAI,qBAAqB,EAAG;YAC3D,IAAI,CAAC,sBAAsB,GAAG,qBAAqB,CAAA;SACnD;IACF,CAAC;IAED,MAAM,KAAK,QAAQ;QAClB,IAAK,CAAC,IA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Q,CAAE,GAAG,CAAE,GAAG,IAAI,CAAC,YAAY,CAAE,KAAK,CAAE,CAAA;gBAC5C,OAAO,QAAQ,CAAA;YAChB,CAAC,EAAE,EAAE,CAAM,CAAA;SACX;QAED,OAAO,KAAK,CAAA;IACb,CAAC;IAEO,aAAa,CAAK,KAA2C;QACpE,IAAK,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAG,OAAO,SAAU,CAAA;QAE9D,IAAO,KAA2C,CAAC,WAAW,EAAG;YAChE,OAAO,uBAAU,CAAC,cAAc,CAAE,KAAyC,CAAO,CAAA;SAClF;QAED,IAAK,KAAK,CAAC,OAAO,CAAE,KAAK,CAAE,EAAG;YAC7B,OAAO,KAAK,CAAC,GAAG,CAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAE,IAAI,CAAE,CAAkB,CAAA;SACtE;QAED,IAAK,OAAO,KAAK,KAAK,QAAQ,EAAG;YAChC,OAAO,MAAM,CAAC,OAAO,CAAE,KAAK,CAAE,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAE,GAAG,EAAE,GAAG,CAAE,EAAE,EAAE;gBAC9D,MAAM,CAAE,GAAG,CAAE,GAAG,IAAI,CAAC,aAAa,CAAE,GAAG,CAAE,CAAA;gBACzC,OAAO,MAAM,CAAA;YACd,CAAC,EAAE,EAAE,CAAM,CAAA;SACX;QAED,OAAO,KAAU,CAAA;IAClB,CAAC;;AApEF,wCAwEC;AArEO,oBAAK,GAAG,EAAE,kBAAkB,EAAE,wHAAwH,EAAE,CAAA"}
@@ -1,24 +0,0 @@
1
- export type UploadProgress = (uploadedBytes: number, fileSize: number) => void;
2
- type CloudStorageFactory = () => CloudStorage;
3
- export interface UploadControl {
4
- pause: () => void;
5
- resume: () => void;
6
- cancel: () => void;
7
- onProgress: (callback: UploadProgress) => void;
8
- }
9
- export type StorableData = File | Blob | Uint8Array | ArrayBuffer;
10
- export declare abstract class CloudStorage {
11
- abstract save(id: string, data: StorableData, progress?: UploadProgress): Promise<string>;
12
- abstract getUrl(reference: string): Promise<string>;
13
- abstract uploadControl(): UploadControl;
14
- abstract delete(reference: string): Promise<void>;
15
- static registerCloudStorage(cloudStorageProviderName: string, factory: CloudStorageFactory): void;
16
- static createInstance(providerName: string): CloudStorage;
17
- get className(): string;
18
- static useCloudStorage(provider: CloudStorage): void;
19
- static get defaultCloudStorage(): CloudStorage;
20
- static _defaultCloudStorage: CloudStorage;
21
- private static _cloudStorageFactoryMap;
22
- }
23
- export declare function registerCloudStorage(cloudStorageProviderName: string, factory: CloudStorageFactory): (constructor: Function) => void;
24
- export {};
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerCloudStorage = exports.CloudStorage = void 0;
4
- class CloudStorage {
5
- static registerCloudStorage(cloudStorageProviderName, factory) {
6
- CloudStorage._cloudStorageFactoryMap[cloudStorageProviderName] = factory;
7
- }
8
- static createInstance(providerName) {
9
- const provider = CloudStorage._cloudStorageFactoryMap[providerName];
10
- if (!provider) {
11
- throw new Error(`You should register the ${providerName} cloud storage provider prior to use it`);
12
- }
13
- return provider();
14
- }
15
- get className() {
16
- return this['__className'];
17
- }
18
- static useCloudStorage(provider) {
19
- CloudStorage._defaultCloudStorage = provider;
20
- }
21
- static get defaultCloudStorage() {
22
- if (!CloudStorage._defaultCloudStorage) {
23
- throw new Error('You should define a default cloud storage provider prior to use it');
24
- }
25
- return CloudStorage._defaultCloudStorage;
26
- }
27
- }
28
- exports.CloudStorage = CloudStorage;
29
- CloudStorage._cloudStorageFactoryMap = {};
30
- function registerCloudStorage(cloudStorageProviderName, factory) {
31
- CloudStorage.registerCloudStorage(cloudStorageProviderName, factory);
32
- return (constructor) => {
33
- constructor.prototype.__className = cloudStorageProviderName;
34
- };
35
- }
36
- exports.registerCloudStorage = registerCloudStorage;
37
- //# sourceMappingURL=cloud-storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloud-storage.js","sourceRoot":"","sources":["../../src/cloud-storage/cloud-storage.ts"],"names":[],"mappings":";;;AAiBA,MAAsB,YAAY;IAMjC,MAAM,CAAC,oBAAoB,CAAE,wBAAgC,EAAE,OAA4B;QAC1F,YAAY,CAAC,uBAAuB,CAAE,wBAAwB,CAAE,GAAG,OAAO,CAAA;IAC3E,CAAC;IAED,MAAM,CAAC,cAAc,CAAE,YAAoB;QAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,uBAAuB,CAAE,YAAY,CAAE,CAAA;QACrE,IAAK,CAAC,QAAQ,EAAG;YAChB,MAAM,IAAI,KAAK,CAAE,2BAA4B,YAAa,yCAAyC,CAAC,CAAA;SACpG;QAED,OAAO,QAAQ,EAAE,CAAA;IAClB,CAAC;IAED,IAAI,SAAS;QACZ,OAAO,IAAI,CAAE,aAAa,CAAE,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,eAAe,CAAE,QAAsB;QAC7C,YAAY,CAAC,oBAAoB,GAAG,QAAQ,CAAA;IAC7C,CAAC;IAED,MAAM,KAAK,mBAAmB;QAC7B,IAAK,CAAC,YAAY,CAAC,oBAAoB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAE,oEAAoE,CAAC,CAAA;SACtF;QACD,OAAO,YAAY,CAAC,oBAAoB,CAAA;IACzC,CAAC;;AAhCF,oCAmCC;AADe,oCAAuB,GAA2B,EAAE,CAAA;AAGpE,SAAgB,oBAAoB,CAAE,wBAAgC,EAAE,OAA4B;IACnG,YAAY,CAAC,oBAAoB,CAAE,wBAAwB,EAAE,OAAO,CAAE,CAAA;IACtE,OAAO,CAAE,WAAqB,EAAG,EAAE;QAClC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,wBAAwB,CAAA;IAC7D,CAAC,CAAA;AACF,CAAC;AALD,oDAKC"}
@@ -1,20 +0,0 @@
1
- import { CloudStorage, StorableData, UploadControl } from './cloud-storage';
2
- export declare class MockCloudStorage extends CloudStorage {
3
- constructor(pathToMockFiles?: string);
4
- /**
5
- * Introduce a delay in the execution of operations to simulate a real data source
6
- * @param miliSeconds the number of milliseconds to delay the execution of operations
7
- * @returns a chainable reference to this object
8
- */
9
- simulateDelay(miliSeconds: number): this;
10
- private resolveWithDelay;
11
- save(id: string, data: StorableData): Promise<string>;
12
- uploadControl(): UploadControl;
13
- getUrl(reference: string): Promise<string>;
14
- delete(reference: string): Promise<void>;
15
- private _simulateDelay;
16
- private _pendingPromises;
17
- private _onProgress;
18
- private _pathToMockFiles;
19
- mockFileSystem: {};
20
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.MockCloudStorage = void 0;
10
- const cloud_storage_1 = require("./cloud-storage");
11
- let MockCloudStorage = class MockCloudStorage extends cloud_storage_1.CloudStorage {
12
- constructor(pathToMockFiles = '') {
13
- super();
14
- this._simulateDelay = 0;
15
- this._pendingPromises = [];
16
- this.mockFileSystem = {};
17
- this._pathToMockFiles = pathToMockFiles;
18
- }
19
- /**
20
- * Introduce a delay in the execution of operations to simulate a real data source
21
- * @param miliSeconds the number of milliseconds to delay the execution of operations
22
- * @returns a chainable reference to this object
23
- */
24
- simulateDelay(miliSeconds) {
25
- this._simulateDelay = miliSeconds;
26
- return this;
27
- }
28
- resolveWithDelay(data) {
29
- if (this._simulateDelay <= 0)
30
- return Promise.resolve(data);
31
- const promise = new Promise(resolve => {
32
- setTimeout(() => resolve(data), this._simulateDelay);
33
- });
34
- this._pendingPromises.push(promise);
35
- promise.finally(() => this._pendingPromises = this._pendingPromises.filter(p => p === promise));
36
- return promise;
37
- }
38
- save(id, data) {
39
- const fullPath = id;
40
- if (this._onProgress)
41
- this._onProgress(0, 100);
42
- this.mockFileSystem[id] = JSON.stringify(data);
43
- if (this._onProgress)
44
- this._onProgress(100, 100);
45
- const ref = data instanceof File ? data.name : fullPath;
46
- return this.resolveWithDelay(ref);
47
- }
48
- uploadControl() {
49
- return {
50
- resume: () => { },
51
- pause: () => { },
52
- cancel: () => { },
53
- onProgress: callback => this._onProgress = callback
54
- };
55
- }
56
- getUrl(reference) {
57
- return Promise.resolve(this._pathToMockFiles + reference);
58
- }
59
- delete(reference) {
60
- delete this.mockFileSystem[reference];
61
- return this.resolveWithDelay();
62
- }
63
- };
64
- exports.MockCloudStorage = MockCloudStorage;
65
- exports.MockCloudStorage = MockCloudStorage = __decorate([
66
- (0, cloud_storage_1.registerCloudStorage)('MockCloudStorage', () => new MockCloudStorage())
67
- ], MockCloudStorage);
68
- //# sourceMappingURL=mock-cloud-storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-cloud-storage.js","sourceRoot":"","sources":["../../src/cloud-storage/mock-cloud-storage.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAiH;AAG1G,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,4BAAY;IACjD,YAAa,kBAA0B,EAAE;QACxC,KAAK,EAAE,CAAA;QA6DA,mBAAc,GAAW,CAAC,CAAA;QAC1B,qBAAgB,GAAmB,EAAE,CAAA;QAGtC,mBAAc,GAAG,EAAE,CAAA;QAhEzB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;IACxC,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAE,WAAmB;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAA;QACjC,OAAO,IAAI,CAAA;IACZ,CAAC;IAEO,gBAAgB,CAAK,IAAQ;QACpC,IAAK,IAAI,CAAC,cAAc,IAAI,CAAC;Y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AAG,QAAQ;SACnD,CAAA;IACF,CAAC;IAED,MAAM,CAAE,SAAiB;QACxB,OAAO,OAAO,CAAC,OAAO,CAAE,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAE,CAAA;IAC5D,CAAC;IAED,MAAM,CAAE,SAAiB;QACxB,OAAO,IAAI,CAAC,cAAc,CAAE,SAAS,CAAE,CAAA;QACvC,OAAO,IAAI,CAAC,gBAAgB,EAAQ,CAAA;IACrC,CAAC;CAOD,CAAA;AApEY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,oCAAoB,EAAE,kBAAkB,EAAE,GAAE,EAAE,CAAA,IAAI,gBAAgB,EAAE,CAAE;GAC1D,gBAAgB,CAoE5B"}
@@ -1,39 +0,0 @@
1
- import { Callback } from '../observable/observable';
2
- import { Persistent } from '../persistent/persistent';
3
- import { CloudStorage, StorableData, UploadControl, UploadProgress } from './cloud-storage';
4
- export declare enum StoredFileEvent {
5
- stored = 0,
6
- pendingDataSet = 1,
7
- deleted = 2
8
- }
9
- export interface StoredFileChange {
10
- event: StoredFileEvent;
11
- pendingData?: StorableData;
12
- storedFile: StoredFile;
13
- }
14
- export interface StoreParams {
15
- data?: StorableData;
16
- fileName?: string;
17
- progress?: UploadProgress;
18
- cloudStorageProvider?: CloudStorage;
19
- }
20
- export declare class StoredFile extends Persistent {
21
- save({ data, fileName, progress, cloudStorageProvider }?: StoreParams): Promise<void>;
22
- uploadControl(): UploadControl;
23
- delete(): Promise<void>;
24
- set provider(value: CloudStorage);
25
- get provider(): CloudStorage;
26
- get url(): string | undefined;
27
- get mimeType(): string | undefined;
28
- setDataToStore(data: StorableData): this;
29
- get originalFileName(): string | undefined;
30
- onChange(listenerCallback: Callback<StoredFileChange>): import("../observable/observable").Unsubscriber;
31
- private _reference;
32
- private _url;
33
- private _cloudStorageProviderName;
34
- private _originalFileName;
35
- private _mimeType;
36
- private _provider;
37
- private _pendingData;
38
- private _onChange;
39
- }