@salesforce/lds-store-binary 1.100.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/LICENSE.txt +82 -0
- package/dist/BinaryStore.d.ts +124 -0
- package/dist/BinaryStore.js +2 -0
- package/dist/BinaryStore.js.map +1 -0
- package/dist/InMemoryBinaryStore.d.ts +20 -0
- package/dist/InMemoryBinaryStore.js +114 -0
- package/dist/InMemoryBinaryStore.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +24 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Terms of Use
|
|
2
|
+
|
|
3
|
+
Copyright 2022 Salesforce, Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
These Terms of Use govern the download, installation, and/or use of this
|
|
6
|
+
software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
|
|
7
|
+
last updated on April 15, 2022, and constitute a legally binding
|
|
8
|
+
agreement between you and Salesforce. If you do not agree to these Terms of
|
|
9
|
+
Use, do not install or use the Software.
|
|
10
|
+
|
|
11
|
+
Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
|
|
12
|
+
copyright license to reproduce, prepare derivative works of, publicly
|
|
13
|
+
display, publicly perform, sublicense, and distribute the Software and
|
|
14
|
+
derivative works subject to these Terms. These Terms shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
Subject to the limited rights expressly granted hereunder, Salesforce
|
|
18
|
+
reserves all rights, title, and interest in and to all intellectual
|
|
19
|
+
property subsisting in the Software. No rights are granted to you hereunder
|
|
20
|
+
other than as expressly set forth herein. Users residing in countries on
|
|
21
|
+
the United States Office of Foreign Assets Control sanction list, or which
|
|
22
|
+
are otherwise subject to a US export embargo, may not use the Software.
|
|
23
|
+
|
|
24
|
+
Implementation of the Software may require development work, for which you
|
|
25
|
+
are responsible. The Software may contain bugs, errors and
|
|
26
|
+
incompatibilities and is made available on an AS IS basis without support,
|
|
27
|
+
updates, or service level commitments.
|
|
28
|
+
|
|
29
|
+
Salesforce reserves the right at any time to modify, suspend, or
|
|
30
|
+
discontinue, the Software (or any part thereof) with or without notice. You
|
|
31
|
+
agree that Salesforce shall not be liable to you or to any third party for
|
|
32
|
+
any modification, suspension, or discontinuance.
|
|
33
|
+
|
|
34
|
+
You agree to defend Salesforce against any claim, demand, suit or
|
|
35
|
+
proceeding made or brought against Salesforce by a third party arising out
|
|
36
|
+
of or accruing from (a) your use of the Software, and (b) any application
|
|
37
|
+
you develop with the Software that infringes any copyright, trademark,
|
|
38
|
+
trade secret, trade dress, patent, or other intellectual property right of
|
|
39
|
+
any person or defames any person or violates their rights of publicity or
|
|
40
|
+
privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
|
|
41
|
+
from any damages, attorney fees, and costs finally awarded against
|
|
42
|
+
Salesforce as a result of, or for any amounts paid by Salesforce under a
|
|
43
|
+
settlement approved by you in writing of, a Claim Against Salesforce,
|
|
44
|
+
provided Salesforce (x) promptly gives you written notice of the Claim
|
|
45
|
+
Against Salesforce, (y) gives you sole control of the defense and
|
|
46
|
+
settlement of the Claim Against Salesforce (except that you may not settle
|
|
47
|
+
any Claim Against Salesforce unless it unconditionally releases Salesforce
|
|
48
|
+
of all liability), and (z) gives you all reasonable assistance, at your
|
|
49
|
+
expense.
|
|
50
|
+
|
|
51
|
+
WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
|
|
52
|
+
SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
|
|
54
|
+
INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
|
|
55
|
+
PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
|
|
56
|
+
OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
|
|
57
|
+
CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
|
|
58
|
+
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
59
|
+
|
|
60
|
+
These Terms of Use shall be governed exclusively by the internal laws of
|
|
61
|
+
the State of California, without regard to its conflicts of laws
|
|
62
|
+
rules. Each party hereby consents to the exclusive jurisdiction of the
|
|
63
|
+
state and federal courts located in San Francisco County, California to
|
|
64
|
+
adjudicate any dispute arising out of or relating to these Terms of Use and
|
|
65
|
+
the download, installation, and/or use of the Software. Except as expressly
|
|
66
|
+
stated herein, these Terms of Use constitute the entire agreement between
|
|
67
|
+
the parties, and supersede all prior and contemporaneous agreements,
|
|
68
|
+
proposals, or representations, written or oral, concerning their subject
|
|
69
|
+
matter. No modification, amendment, or waiver of any provision of these
|
|
70
|
+
Terms of Use shall be effective unless it is by an update to these Terms of
|
|
71
|
+
Use that Salesforce makes available, or is in writing and signed by the
|
|
72
|
+
party against whom the modification, amendment, or waiver is to be
|
|
73
|
+
asserted.
|
|
74
|
+
|
|
75
|
+
Data Privacy: Salesforce may collect, process, and store device,
|
|
76
|
+
system, and other information related to your use of the Software. This
|
|
77
|
+
information includes, but is not limited to, IP address, user metrics, and
|
|
78
|
+
other data ("Usage Data"). Salesforce may use Usage Data for analytics,
|
|
79
|
+
product development, and marketing purposes. You acknowledge that files
|
|
80
|
+
generated in conjunction with the Software may contain sensitive or
|
|
81
|
+
confidential data, and you are solely responsible for anonymizing and
|
|
82
|
+
protecting such data.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object that sets options for the get operation. Loosely based on
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Cache/match#options
|
|
4
|
+
*/
|
|
5
|
+
export interface GetOptions {
|
|
6
|
+
/**
|
|
7
|
+
* A boolean value that specifies whether to ignore the query string in the
|
|
8
|
+
* URL as a fallback when an exact match isn't found in the cache.
|
|
9
|
+
*
|
|
10
|
+
* It defaults to false.
|
|
11
|
+
*
|
|
12
|
+
* Ignoring the query string means everything after a "?" in the URI
|
|
13
|
+
* will be ignored. For example, if set to true the ?value=bar part of
|
|
14
|
+
* http://foo.com/?value=bar would be ignored when performing a fallback match.
|
|
15
|
+
*
|
|
16
|
+
* Cache lookup behavior when set to true:
|
|
17
|
+
* 1. If there is an exact match (ie: URI including query string) in the cache
|
|
18
|
+
* that will be returned.
|
|
19
|
+
* 2. If that is not present then the first non-exact match (ie: URI ignoring
|
|
20
|
+
* query string) will be returned while the exact match is retrieved in the
|
|
21
|
+
* background (a sort-of "fallback-while-revalidate" cache policy). Note that
|
|
22
|
+
* a background download of the exact match will only happen if the fallback entry
|
|
23
|
+
* has a remote (ie: canonical) URL (because you can't "download" from a local URI).
|
|
24
|
+
* 3. If a fallback match is not present then null will be returned.
|
|
25
|
+
*/
|
|
26
|
+
ignoreQueryFallback: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An interface for interacting with a store for binary files.
|
|
30
|
+
*
|
|
31
|
+
* Implementation Notes:
|
|
32
|
+
*
|
|
33
|
+
* The BinaryStore can be used as a "store" where the file in the store is the only
|
|
34
|
+
* copy and there is essentially no expiration (the file is never stale). Or it can be
|
|
35
|
+
* used as a "cache" where the canonical copy of the file exists somewhere else (like
|
|
36
|
+
* on a remote server).
|
|
37
|
+
*
|
|
38
|
+
* The caching behavior should follow the "stale-while-revalidate" pattern, where
|
|
39
|
+
* a cached file (which has a non-null expiration and a canonical URI) should always
|
|
40
|
+
* return the cached version, and if the file is past expiration (ie: "stale") then
|
|
41
|
+
* the implementation should attempt to re-downloaded the file from the canonical
|
|
42
|
+
* URL in the background.
|
|
43
|
+
*
|
|
44
|
+
* Implementations should adhere to the following requirements:
|
|
45
|
+
* - if {@link get} is called for a stale binary file then return the stale
|
|
46
|
+
* file to the caller and attempt to download the latest version of the file
|
|
47
|
+
* from the canonical URL in the background.
|
|
48
|
+
*/
|
|
49
|
+
export interface BinaryStore {
|
|
50
|
+
/**
|
|
51
|
+
* Stores a binary file in the store. The file will not have a TTL. This is
|
|
52
|
+
* meant to store local-only files.
|
|
53
|
+
*
|
|
54
|
+
* @param data The data of the binary file to put into the store.
|
|
55
|
+
* @param type The MIME type of the binary file. Ex: "image/png".
|
|
56
|
+
* @param size The number of bytes of data contained within the file.
|
|
57
|
+
* @returns A Promise of a string representing the URI of the binary file. NOTE: the URI
|
|
58
|
+
* to a binary file should be treated as opaque (only use it to pass into methods
|
|
59
|
+
* on this interface).
|
|
60
|
+
*/
|
|
61
|
+
store(data: Uint8Array, type: string, size: number): Promise<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Caches a binary file in the store. This is meant to locally cache a file
|
|
64
|
+
* thats source-of-truth exists at the given URL.
|
|
65
|
+
*
|
|
66
|
+
* If the file is unable to be downloaded this will return a rejected promise
|
|
67
|
+
* of an {@link Error}.
|
|
68
|
+
*
|
|
69
|
+
* This method should return a URI to the file, which may or may not be the
|
|
70
|
+
* same as the remote URL. In other words, the URI returned to callers should
|
|
71
|
+
* be treated as opaque by the callers.
|
|
72
|
+
*
|
|
73
|
+
* @param url The URL of the file.
|
|
74
|
+
* @param ttlSeconds The TTL in seconds for this file. The file's expiration
|
|
75
|
+
* should be calculated by Date.now + ttlSeconds.
|
|
76
|
+
* @returns A Promise of a string representing the URI of the binary file. NOTE: the URI
|
|
77
|
+
* to a binary file should be treated as opaque (only use it to pass into methods
|
|
78
|
+
* on this interface).
|
|
79
|
+
*/
|
|
80
|
+
cache(url: string, ttlSeconds: number): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the binary file given its URI.
|
|
83
|
+
*
|
|
84
|
+
* @param uri The URI of the binary file
|
|
85
|
+
* @returns A Promise of the data of the binary file, or null if not present. If the file
|
|
86
|
+
* is stale then the stale file will be returned and a network request to re-download
|
|
87
|
+
* the latest version of the file will be kicked off (ie: stale-while-revalidate).
|
|
88
|
+
*/
|
|
89
|
+
get(uri: string, options?: GetOptions): Promise<Uint8Array | null>;
|
|
90
|
+
/**
|
|
91
|
+
* Deletes the binary file given its URI. If the file doesn't exist this
|
|
92
|
+
* method will do nothing.
|
|
93
|
+
*
|
|
94
|
+
* @param uri The URI of the binary file
|
|
95
|
+
* @returns A Promise that is resolved once the binary file is removed from
|
|
96
|
+
* the store.
|
|
97
|
+
*/
|
|
98
|
+
delete(uri: string): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Set the canonical URL for the file at the given uri. The file will immediately
|
|
101
|
+
* be marked as stale (since we know the file's source of truth has changed).
|
|
102
|
+
*
|
|
103
|
+
* If there is no file at the given URI then this method will immediately cache
|
|
104
|
+
* the file at the canonicalUrl (essentially the same as calling {@link cache}).
|
|
105
|
+
*
|
|
106
|
+
* This method should return a URI to the file, which may or may not be
|
|
107
|
+
* different from the original URI, and may or may not be the same as the
|
|
108
|
+
* canonicalUrl. In other words, the URI returned to callers should be treated
|
|
109
|
+
* as opaque by the callers.
|
|
110
|
+
*
|
|
111
|
+
* This will most commonly be called by code that knows that the local file at the
|
|
112
|
+
* URI has been uploaded to a server and knows the new canonical URL to that file.
|
|
113
|
+
*
|
|
114
|
+
* @param uri The URI of the existing, local binary file
|
|
115
|
+
* @param canonicalUrl The new, canonical URL (a URL is a type of URI) of the file
|
|
116
|
+
* @param ttlSeconds The TTL in seconds for this file. The file's expiration
|
|
117
|
+
* should be calculated by Date.now + ttlSeconds.
|
|
118
|
+
* @returns The new URI to the file, which may or may not be the same as canonicalUrl
|
|
119
|
+
* (some hybrid implementations might pass back a custom protocol-based URI
|
|
120
|
+
* different from the canonicalUrl, remember that callers should treat URIs
|
|
121
|
+
* as opaque).
|
|
122
|
+
*/
|
|
123
|
+
setCanonicalUrl(uri: string, canonicalUrl: string, ttlSeconds: number): Promise<string>;
|
|
124
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinaryStore.js","sourceRoot":"","sources":["../src/BinaryStore.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BinaryStore, GetOptions } from './BinaryStore';
|
|
2
|
+
/**
|
|
3
|
+
* A simple in-memory implementation of BinaryStore interface. Useful for
|
|
4
|
+
* testing/debugging.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InMemoryBinaryStore implements BinaryStore {
|
|
7
|
+
private readonly networkAdapter;
|
|
8
|
+
private counter;
|
|
9
|
+
private fileInfoMap;
|
|
10
|
+
private buildUniqueUri;
|
|
11
|
+
constructor(networkAdapter: (uri: string) => Promise<{
|
|
12
|
+
data: Uint8Array;
|
|
13
|
+
type: string;
|
|
14
|
+
}>);
|
|
15
|
+
store(data: Uint8Array, type: string, size: number): Promise<string>;
|
|
16
|
+
cache(url: string, ttlSeconds: number): Promise<string>;
|
|
17
|
+
get(uri: string, options?: GetOptions): Promise<Uint8Array | null>;
|
|
18
|
+
delete(uri: string): Promise<void>;
|
|
19
|
+
setCanonicalUrl(uri: string, canonicalUrl: string, ttlSeconds: number): Promise<string>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple in-memory implementation of BinaryStore interface. Useful for
|
|
3
|
+
* testing/debugging.
|
|
4
|
+
*/
|
|
5
|
+
export class InMemoryBinaryStore {
|
|
6
|
+
// going to use valid URLs for our local URIs so that we can leverage
|
|
7
|
+
// the URL class when we need to strip off query params
|
|
8
|
+
buildUniqueUri() {
|
|
9
|
+
return `inmemorybinarystore://${this.counter++}`;
|
|
10
|
+
}
|
|
11
|
+
constructor(networkAdapter) {
|
|
12
|
+
this.networkAdapter = networkAdapter;
|
|
13
|
+
this.counter = 0;
|
|
14
|
+
this.fileInfoMap = new Map();
|
|
15
|
+
}
|
|
16
|
+
async store(data, type, size) {
|
|
17
|
+
const uri = this.buildUniqueUri();
|
|
18
|
+
this.fileInfoMap.set(uri, {
|
|
19
|
+
data,
|
|
20
|
+
type,
|
|
21
|
+
size,
|
|
22
|
+
canonicalUrl: null,
|
|
23
|
+
ttlSeconds: null,
|
|
24
|
+
expiration: null,
|
|
25
|
+
});
|
|
26
|
+
return uri;
|
|
27
|
+
}
|
|
28
|
+
async cache(url, ttlSeconds) {
|
|
29
|
+
const { data, type } = await this.networkAdapter(url);
|
|
30
|
+
const uri = this.buildUniqueUri();
|
|
31
|
+
this.fileInfoMap.set(uri, {
|
|
32
|
+
data,
|
|
33
|
+
type,
|
|
34
|
+
size: data.length,
|
|
35
|
+
canonicalUrl: url,
|
|
36
|
+
ttlSeconds,
|
|
37
|
+
expiration: Date.now() + ttlSeconds * 1000,
|
|
38
|
+
});
|
|
39
|
+
return uri;
|
|
40
|
+
}
|
|
41
|
+
async get(uri, options) {
|
|
42
|
+
const fileInfo = this.fileInfoMap.get(uri);
|
|
43
|
+
if (fileInfo !== undefined) {
|
|
44
|
+
const { expiration, canonicalUrl, ttlSeconds, data } = fileInfo;
|
|
45
|
+
if (expiration !== null &&
|
|
46
|
+
canonicalUrl !== null &&
|
|
47
|
+
ttlSeconds !== null &&
|
|
48
|
+
expiration > Date.now()) {
|
|
49
|
+
// if expired then refresh in background
|
|
50
|
+
this.networkAdapter(canonicalUrl).then(({ data: refreshedData, type }) => {
|
|
51
|
+
this.fileInfoMap.set(uri, {
|
|
52
|
+
...fileInfo,
|
|
53
|
+
data: refreshedData,
|
|
54
|
+
type,
|
|
55
|
+
size: refreshedData.length,
|
|
56
|
+
expiration: Date.now() + ttlSeconds * 1000,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return data;
|
|
61
|
+
}
|
|
62
|
+
// fallback to ignoreQuery match if requested
|
|
63
|
+
if (options && options.ignoreQueryFallback === true) {
|
|
64
|
+
const asUrl = new URL(uri);
|
|
65
|
+
const originalSearchString = asUrl.search;
|
|
66
|
+
// set the URL search to empty as an easy way to strip query string
|
|
67
|
+
asUrl.search = '';
|
|
68
|
+
const noQuery = asUrl.toString();
|
|
69
|
+
const noQueryMatch = this.fileInfoMap.get(noQuery);
|
|
70
|
+
if (noQueryMatch !== undefined) {
|
|
71
|
+
// if the non-exact match has a canonicalUrl then attempt to get
|
|
72
|
+
// exact match from network in background
|
|
73
|
+
const { canonicalUrl, ttlSeconds, data } = noQueryMatch;
|
|
74
|
+
if (canonicalUrl !== null && ttlSeconds !== null) {
|
|
75
|
+
const refreshUrl = new URL(canonicalUrl);
|
|
76
|
+
refreshUrl.search = originalSearchString;
|
|
77
|
+
const refreshCanonicalUrl = refreshUrl.toString();
|
|
78
|
+
this.networkAdapter(refreshCanonicalUrl).then(({ data: refreshedData, type }) => {
|
|
79
|
+
this.fileInfoMap.set(uri, {
|
|
80
|
+
canonicalUrl: refreshCanonicalUrl,
|
|
81
|
+
ttlSeconds,
|
|
82
|
+
data: refreshedData,
|
|
83
|
+
type,
|
|
84
|
+
size: refreshedData.length,
|
|
85
|
+
expiration: Date.now() + ttlSeconds * 1000,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
async delete(uri) {
|
|
95
|
+
this.fileInfoMap.delete(uri);
|
|
96
|
+
}
|
|
97
|
+
async setCanonicalUrl(uri, canonicalUrl, ttlSeconds) {
|
|
98
|
+
const fileInfo = this.fileInfoMap.get(uri);
|
|
99
|
+
// if the local file doesn't exist treat this same as calling "cache"
|
|
100
|
+
if (fileInfo === undefined) {
|
|
101
|
+
return this.cache(canonicalUrl, ttlSeconds);
|
|
102
|
+
}
|
|
103
|
+
// else update the canonicalUrl and expiration info
|
|
104
|
+
this.fileInfoMap.set(uri, {
|
|
105
|
+
...fileInfo,
|
|
106
|
+
canonicalUrl,
|
|
107
|
+
ttlSeconds,
|
|
108
|
+
// immediately expire
|
|
109
|
+
expiration: Date.now() - 1,
|
|
110
|
+
});
|
|
111
|
+
return uri;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=InMemoryBinaryStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InMemoryBinaryStore.js","sourceRoot":"","sources":["../src/InMemoryBinaryStore.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAI5B,qEAAqE;IACrE,uDAAuD;IAC/C,cAAc;QAClB,OAAO,yBAAyB,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrD,CAAC;IAED,YACqB,cAE+B;QAF/B,mBAAc,GAAd,cAAc,CAEiB;QAZ5C,YAAO,GAAG,CAAC,CAAC;QACZ,gBAAW,GAAG,IAAI,GAAG,EAAoB,CAAC;IAY/C,CAAC;IAEJ,KAAK,CAAC,KAAK,CAAC,IAAgB,EAAE,IAAY,EAAE,IAAY;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAElC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE;YACtB,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACf,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,GAAW,EAAE,UAAkB;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAEtD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAElC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE;YACtB,IAAI;YACJ,IAAI;YACJ,IAAI,EAAE,IAAI,CAAC,MAAM;YACjB,YAAY,EAAE,GAAG;YACjB,UAAU;YACV,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ACxB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;SAC/C;QAED,mDAAmD;QACnD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE;YACtB,GAAG,QAAQ;YACX,YAAY;YACZ,UAAU;YACV,qBAAqB;YACrB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;SAC7B,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACf,CAAC;CACJ"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/lds-store-binary",
|
|
3
|
+
"version": "1.100.1",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
+
"description": "Interface for interacting with a binary file store/cache",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prepare": "yarn build",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"build": "tsc"
|
|
23
|
+
}
|
|
24
|
+
}
|