@zs-soft/cloud 0.10.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.
- package/README.md +64 -0
- package/fesm2022/zs-soft-cloud.mjs +173 -0
- package/fesm2022/zs-soft-cloud.mjs.map +1 -0
- package/package.json +49 -0
- package/types/zs-soft-cloud.d.ts +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Cloud
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.0.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build cloud
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/cloud
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injector, runInInjectionContext, Injectable } from '@angular/core';
|
|
3
|
+
import { Functions, httpsCallable } from '@angular/fire/functions';
|
|
4
|
+
import { CloudService } from '@zs-soft/core-api';
|
|
5
|
+
|
|
6
|
+
class CloudServiceImpl extends CloudService {
|
|
7
|
+
functions = inject(Functions);
|
|
8
|
+
injector = inject(Injector);
|
|
9
|
+
async checkBootstrapStatus() {
|
|
10
|
+
return runInInjectionContext(this.injector, async () => {
|
|
11
|
+
try {
|
|
12
|
+
const callable = httpsCallable(this.functions, 'checkBootstrapStatus');
|
|
13
|
+
const result = await callable({});
|
|
14
|
+
return result.data;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return {
|
|
18
|
+
success: false,
|
|
19
|
+
message: error.message || 'Failed to check bootstrap status',
|
|
20
|
+
data: {
|
|
21
|
+
isBootstrapped: false,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async createUserAndSendPasswordReset(email, displayName, sendEmail = true) {
|
|
28
|
+
return runInInjectionContext(this.injector, async () => {
|
|
29
|
+
try {
|
|
30
|
+
const callable = httpsCallable(this.functions, 'createUserAndSendPasswordReset');
|
|
31
|
+
const result = await callable({ email, displayName, sendEmail });
|
|
32
|
+
return result.data;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
message: error.message || 'Failed to create user',
|
|
38
|
+
uid: '',
|
|
39
|
+
userId: '',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async sendPasswordResetEmail(email) {
|
|
45
|
+
return runInInjectionContext(this.injector, async () => {
|
|
46
|
+
try {
|
|
47
|
+
const callable = httpsCallable(this.functions, 'sendPasswordResetEmail');
|
|
48
|
+
const result = await callable({ email });
|
|
49
|
+
return result.data;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
message: error.message || 'Failed to send password reset email',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async sendWelcomeEmail(email, displayName, firstName, lastName, roles) {
|
|
60
|
+
return runInInjectionContext(this.injector, async () => {
|
|
61
|
+
try {
|
|
62
|
+
const callable = httpsCallable(this.functions, 'sendWelcomeEmail');
|
|
63
|
+
const result = await callable({
|
|
64
|
+
email,
|
|
65
|
+
displayName,
|
|
66
|
+
firstName,
|
|
67
|
+
lastName,
|
|
68
|
+
roles,
|
|
69
|
+
});
|
|
70
|
+
return result.data;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
success: false,
|
|
75
|
+
message: error.message || 'Failed to send welcome email',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async systemBootstrap(adminEmail, adminDisplayName, adminPassword) {
|
|
81
|
+
return runInInjectionContext(this.injector, async () => {
|
|
82
|
+
try {
|
|
83
|
+
const callable = httpsCallable(this.functions, 'systemBootstrap');
|
|
84
|
+
const result = await callable({
|
|
85
|
+
adminEmail,
|
|
86
|
+
adminDisplayName,
|
|
87
|
+
adminPassword,
|
|
88
|
+
});
|
|
89
|
+
return result.data;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
success: false,
|
|
94
|
+
message: error.message || 'System bootstrap failed',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async createUser(request) {
|
|
100
|
+
return runInInjectionContext(this.injector, async () => {
|
|
101
|
+
try {
|
|
102
|
+
const callable = httpsCallable(this.functions, 'createUserWithEmail');
|
|
103
|
+
const result = await callable(request);
|
|
104
|
+
return result.data;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error('Error creating user:', error);
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
registerUserWithWelcomeEmail(email, password, firstName, lastName, options) {
|
|
113
|
+
return this.createUser({
|
|
114
|
+
email,
|
|
115
|
+
password,
|
|
116
|
+
firstName,
|
|
117
|
+
lastName,
|
|
118
|
+
...options,
|
|
119
|
+
sendWelcomeEmail: true,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
registerUserWithoutEmail(email, password, firstName, lastName, options) {
|
|
123
|
+
return this.createUser({
|
|
124
|
+
email,
|
|
125
|
+
password,
|
|
126
|
+
firstName,
|
|
127
|
+
lastName,
|
|
128
|
+
...options,
|
|
129
|
+
sendWelcomeEmail: false,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
async generateThumbnail(params) {
|
|
133
|
+
try {
|
|
134
|
+
const callable = httpsCallable(this.functions, 'generateThumbnail');
|
|
135
|
+
const result = await callable(params);
|
|
136
|
+
return result.data;
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
return { success: false, message: error.message || 'Failed to generate thumbnail' };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async createAppConfig(request) {
|
|
143
|
+
return runInInjectionContext(this.injector, async () => {
|
|
144
|
+
try {
|
|
145
|
+
const callable = httpsCallable(this.functions, 'createAppConfig');
|
|
146
|
+
const result = await callable(request);
|
|
147
|
+
return result.data;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
message: error.message || 'Failed to create app config',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: CloudServiceImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
158
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: CloudServiceImpl });
|
|
159
|
+
}
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: CloudServiceImpl, decorators: [{
|
|
161
|
+
type: Injectable
|
|
162
|
+
}] });
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
* Public API Surface of cloud
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Generated bundle index. Do not edit.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
export { CloudServiceImpl };
|
|
173
|
+
//# sourceMappingURL=zs-soft-cloud.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zs-soft-cloud.mjs","sources":["../../../projects/cloud/src/lib/cloud.service.impl.ts","../../../projects/cloud/src/public-api.ts","../../../projects/cloud/src/zs-soft-cloud.ts"],"sourcesContent":["import { inject, Injectable, Injector, runInInjectionContext } from '@angular/core';\nimport { Functions, httpsCallable } from '@angular/fire/functions';\nimport {\n BootstrapStatusResult,\n CloudFunctionResult,\n CloudService,\n CreateAppConfigRequest,\n CreateAppConfigResult,\n CreateUserAndSendPasswordResetResult,\n CreateUserRequest,\n CreateUserResponse,\n} from '@zs-soft/core-api';\n\n@Injectable()\nexport class CloudServiceImpl extends CloudService {\n private readonly functions = inject(Functions);\n private readonly injector = inject(Injector);\n\n public async checkBootstrapStatus(): Promise<BootstrapStatusResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable(this.functions, 'checkBootstrapStatus');\n const result = await callable({});\n return result.data as BootstrapStatusResult;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'Failed to check bootstrap status',\n data: {\n isBootstrapped: false,\n },\n };\n }\n });\n }\n\n public async createUserAndSendPasswordReset(\n email: string,\n displayName?: string,\n sendEmail: boolean = true,\n ): Promise<CreateUserAndSendPasswordResetResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable(this.functions, 'createUserAndSendPasswordReset');\n const result = await callable({ email, displayName, sendEmail });\n return result.data as CreateUserAndSendPasswordResetResult;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'Failed to create user',\n uid: '',\n userId: '',\n };\n }\n });\n }\n\n public async sendPasswordResetEmail(email: string): Promise<CloudFunctionResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable(this.functions, 'sendPasswordResetEmail');\n const result = await callable({ email });\n return result.data as CloudFunctionResult;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'Failed to send password reset email',\n };\n }\n });\n }\n\n public async sendWelcomeEmail(\n email: string,\n displayName: string,\n firstName?: string,\n lastName?: string,\n roles?: string[],\n ): Promise<CloudFunctionResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable(this.functions, 'sendWelcomeEmail');\n const result = await callable({\n email,\n displayName,\n firstName,\n lastName,\n roles,\n });\n return result.data as CloudFunctionResult;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'Failed to send welcome email',\n };\n }\n });\n }\n\n public async systemBootstrap(\n adminEmail: string,\n adminDisplayName?: string,\n adminPassword?: string,\n ): Promise<CloudFunctionResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable(this.functions, 'systemBootstrap');\n const result = await callable({\n adminEmail,\n adminDisplayName,\n adminPassword,\n });\n return result.data as CloudFunctionResult;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'System bootstrap failed',\n };\n }\n });\n }\n\n async createUser(request: CreateUserRequest): Promise<CreateUserResponse> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable<CreateUserRequest, CreateUserResponse>(\n this.functions,\n 'createUserWithEmail',\n );\n const result = await callable(request);\n return result.data;\n } catch (error) {\n console.error('Error creating user:', error);\n throw error;\n }\n });\n }\n\n registerUserWithWelcomeEmail(\n email: string,\n password: string,\n firstName: string,\n lastName: string,\n options?: {\n displayName?: string;\n phoneNumber?: string;\n photoURL?: string;\n disabled?: boolean;\n loginUrl?: string;\n },\n ): Promise<CreateUserResponse> {\n return this.createUser({\n email,\n password,\n firstName,\n lastName,\n ...options,\n sendWelcomeEmail: true,\n });\n }\n\n registerUserWithoutEmail(\n email: string,\n password: string,\n firstName: string,\n lastName: string,\n options?: {\n displayName?: string;\n phoneNumber?: string;\n photoURL?: string;\n disabled?: boolean;\n },\n ): Promise<CreateUserResponse> {\n return this.createUser({\n email,\n password,\n firstName,\n lastName,\n ...options,\n sendWelcomeEmail: false,\n });\n }\n\n public async generateThumbnail(params: {\n path: string;\n documentId?: string;\n maxWidth?: number;\n maxHeight?: number;\n force?: boolean;\n }): Promise<\n CloudFunctionResult & {\n thumbPath?: string;\n documentUpdated?: boolean;\n originalFilePath?: string;\n }\n > {\n try {\n const callable = httpsCallable(this.functions, 'generateThumbnail');\n const result = await callable(params);\n return result.data as any;\n } catch (error: any) {\n return { success: false, message: error.message || 'Failed to generate thumbnail' } as any;\n }\n }\n\n public async createAppConfig(request: CreateAppConfigRequest): Promise<CreateAppConfigResult> {\n return runInInjectionContext(this.injector, async () => {\n try {\n const callable = httpsCallable<CreateAppConfigRequest, CreateAppConfigResult>(\n this.functions,\n 'createAppConfig',\n );\n const result = await callable(request);\n return result.data;\n } catch (error: any) {\n return {\n success: false,\n message: error.message || 'Failed to create app config',\n };\n }\n });\n }\n}\n","/*\n * Public API Surface of cloud\n */\n\nexport * from './lib/cloud.service.impl';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcM,MAAO,gBAAiB,SAAQ,YAAY,CAAA;AAC/B,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAErC,IAAA,MAAM,oBAAoB,GAAA;QAC/B,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAW;AACrD,YAAA,IAAI;gBACF,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC;AACtE,gBAAA,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,EAAE,CAAC;gBACjC,OAAO,MAAM,CAAC,IAA6B;YAC7C;YAAE,OAAO,KAAU,EAAE;gBACnB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,kCAAkC;AAC5D,oBAAA,IAAI,EAAE;AACJ,wBAAA,cAAc,EAAE,KAAK;AACtB,qBAAA;iBACF;YACH;AACF,QAAA,CAAC,CAAC;IACJ;IAEO,MAAM,8BAA8B,CACzC,KAAa,EACb,WAAoB,EACpB,YAAqB,IAAI,EAAA;QAEzB,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAW;AACrD,YAAA,IAAI;gBACF,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,gCAAgC,CAAC;AAChF,gBAAA,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;gBAChE,OAAO,MAAM,CAAC,IAA4C;YAC5D;YAAE,OAA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AA,EAAA,CAAA;kBAD5B;;;ACbD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zs-soft/cloud",
|
|
3
|
+
"tags": [
|
|
4
|
+
"type:util",
|
|
5
|
+
"scope:infra"
|
|
6
|
+
],
|
|
7
|
+
"version": "0.10.0",
|
|
8
|
+
"description": "Cloud functions service library for Angular applications",
|
|
9
|
+
"author": "zssz-soft",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/zssz-soft/libraries.git",
|
|
14
|
+
"directory": "projects/cloud"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/zssz-soft/libraries/tree/main/projects/cloud",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/zssz-soft/libraries/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"angular",
|
|
22
|
+
"cloud",
|
|
23
|
+
"firebase-functions"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@angular/common": "^21.2.0",
|
|
30
|
+
"@angular/core": "^21.2.0",
|
|
31
|
+
"@angular/fire": "^21.2.0",
|
|
32
|
+
"@zs-soft/core-api": "^0.10.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"tslib": "^2.3.0"
|
|
36
|
+
},
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"module": "fesm2022/zs-soft-cloud.mjs",
|
|
39
|
+
"typings": "types/zs-soft-cloud.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
"./package.json": {
|
|
42
|
+
"default": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./types/zs-soft-cloud.d.ts",
|
|
46
|
+
"default": "./fesm2022/zs-soft-cloud.mjs"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CloudService, BootstrapStatusResult, CreateUserAndSendPasswordResetResult, CloudFunctionResult, CreateUserRequest, CreateUserResponse, CreateAppConfigRequest, CreateAppConfigResult } from '@zs-soft/core-api';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class CloudServiceImpl extends CloudService {
|
|
5
|
+
private readonly functions;
|
|
6
|
+
private readonly injector;
|
|
7
|
+
checkBootstrapStatus(): Promise<BootstrapStatusResult>;
|
|
8
|
+
createUserAndSendPasswordReset(email: string, displayName?: string, sendEmail?: boolean): Promise<CreateUserAndSendPasswordResetResult>;
|
|
9
|
+
sendPasswordResetEmail(email: string): Promise<CloudFunctionResult>;
|
|
10
|
+
sendWelcomeEmail(email: string, displayName: string, firstName?: string, lastName?: string, roles?: string[]): Promise<CloudFunctionResult>;
|
|
11
|
+
systemBootstrap(adminEmail: string, adminDisplayName?: string, adminPassword?: string): Promise<CloudFunctionResult>;
|
|
12
|
+
createUser(request: CreateUserRequest): Promise<CreateUserResponse>;
|
|
13
|
+
registerUserWithWelcomeEmail(email: string, password: string, firstName: string, lastName: string, options?: {
|
|
14
|
+
displayName?: string;
|
|
15
|
+
phoneNumber?: string;
|
|
16
|
+
photoURL?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
loginUrl?: string;
|
|
19
|
+
}): Promise<CreateUserResponse>;
|
|
20
|
+
registerUserWithoutEmail(email: string, password: string, firstName: string, lastName: string, options?: {
|
|
21
|
+
displayName?: string;
|
|
22
|
+
phoneNumber?: string;
|
|
23
|
+
photoURL?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}): Promise<CreateUserResponse>;
|
|
26
|
+
generateThumbnail(params: {
|
|
27
|
+
path: string;
|
|
28
|
+
documentId?: string;
|
|
29
|
+
maxWidth?: number;
|
|
30
|
+
maxHeight?: number;
|
|
31
|
+
force?: boolean;
|
|
32
|
+
}): Promise<CloudFunctionResult & {
|
|
33
|
+
thumbPath?: string;
|
|
34
|
+
documentUpdated?: boolean;
|
|
35
|
+
originalFilePath?: string;
|
|
36
|
+
}>;
|
|
37
|
+
createAppConfig(request: CreateAppConfigRequest): Promise<CreateAppConfigResult>;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CloudServiceImpl, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CloudServiceImpl>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { CloudServiceImpl };
|