@yomotech/view-toolkit 1.0.10 → 1.0.12
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/package.json
CHANGED
|
@@ -26,7 +26,7 @@ declare class RequestService {
|
|
|
26
26
|
getInfo(url: string): rxjs.Observable<Object>;
|
|
27
27
|
dynamicCall(method: string | undefined, body: any | undefined, url: string, passToken?: boolean, selectedProject?: string, userInfo?: any): rxjs.Observable<Object>;
|
|
28
28
|
createAuthorizationHeader(userInfo: any, tokenExist?: boolean): HttpHeaders;
|
|
29
|
-
getLoginUser(token: any): rxjs.Observable<Object>;
|
|
29
|
+
getLoginUser(token: any, issuer?: string): rxjs.Observable<Object>;
|
|
30
30
|
saveDb(token: any, userInfo: any, order?: any): void;
|
|
31
31
|
getSaveOrder(token: string, userInfo: any, fromDate: string, toDate: string): rxjs.Observable<Object>;
|
|
32
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<RequestService, never>;
|
|
@@ -112,11 +112,38 @@ declare class Couchdb {
|
|
|
112
112
|
private getImageMimeType;
|
|
113
113
|
private fromBase64;
|
|
114
114
|
private isJsonFile;
|
|
115
|
+
/**
|
|
116
|
+
* Decides whether a stored file may be decoded as UTF-8 text.
|
|
117
|
+
*
|
|
118
|
+
* Only what is recognised here is decoded; everything else is handed back as
|
|
119
|
+
* binary. Note that SVG counts as binary on purpose even though it is text:
|
|
120
|
+
* callers such as the menu icons expect the media object with a `src`, and
|
|
121
|
+
* classifying it as text would change the shape they receive.
|
|
122
|
+
*/
|
|
123
|
+
private isTextFile;
|
|
115
124
|
private getDocumentUrl;
|
|
116
125
|
private getDbUrl;
|
|
117
126
|
private getReadHeaders;
|
|
118
127
|
private buildTenantHeaders;
|
|
119
128
|
getImageSrcFromCouchDb(couchDbName: string, filePath: string): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Returns a URL that a <video>, <audio> or <img> element can load directly.
|
|
131
|
+
*
|
|
132
|
+
* Unlike getImageSrcFromCouchDb above, this never reads the file. It asks
|
|
133
|
+
* jwt-auth for a short-lived signed URL and hands that back, so the browser
|
|
134
|
+
* fetches the attachment itself - with Range requests, so a video starts on
|
|
135
|
+
* the first chunk and a seek costs one request instead of the whole file.
|
|
136
|
+
*
|
|
137
|
+
* The reason a signed URL is needed at all: a media element issues its own
|
|
138
|
+
* HTTP requests, for the initial load and again for every seek, and those
|
|
139
|
+
* requests carry none of the tenant headers buildTenantHeaders adds here.
|
|
140
|
+
* The token in the query string is the only credential the element can pass.
|
|
141
|
+
*
|
|
142
|
+
* The path comes back from the endpoint and is used as given. The signature
|
|
143
|
+
* covers the raw, still-encoded path, so rebuilding it here with a different
|
|
144
|
+
* encoding would produce a URL that fails with a bare 403.
|
|
145
|
+
*/
|
|
146
|
+
getMediaUrlFromCouchDb(couchDbName: string, filePath: string, attachmentName?: string): Promise<string>;
|
|
120
147
|
static ɵfac: i0.ɵɵFactoryDeclaration<Couchdb, never>;
|
|
121
148
|
static ɵprov: i0.ɵɵInjectableDeclaration<Couchdb>;
|
|
122
149
|
}
|