@react-pakistan/util-functions 1.24.49 → 1.24.50
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/general/upload-blob-to-private-supabase.d.ts +2 -1
- package/general/upload-blob-to-private-supabase.js +2 -2
- package/general/upload-blob-to-public-supabase.d.ts +2 -1
- package/general/upload-blob-to-public-supabase.js +2 -2
- package/general/upload-image-to-private-supabase.d.ts +2 -1
- package/general/upload-image-to-private-supabase.js +2 -2
- package/general/upload-image-to-public-supabase.d.ts +2 -1
- package/general/upload-image-to-public-supabase.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export interface UploadBlobToPrivateSupabaseArgs {
|
|
2
2
|
blob: Blob;
|
|
3
|
+
cacheControl?: string;
|
|
3
4
|
contentType: string;
|
|
4
5
|
fileRef: string;
|
|
5
6
|
supabase: any;
|
|
6
7
|
upsert: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const uploadBlobToPrivateSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadBlobToPrivateSupabaseArgs) => Promise<{
|
|
9
|
+
export declare const uploadBlobToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPrivateSupabaseArgs) => Promise<{
|
|
9
10
|
data: any;
|
|
10
11
|
error: any;
|
|
11
12
|
}>;
|
|
@@ -40,13 +40,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.uploadBlobToPrivateSupabase = void 0;
|
|
41
41
|
var uploadBlobToPrivateSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
42
|
var _c, data, error;
|
|
43
|
-
var blob = _b.blob, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
43
|
+
var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
44
44
|
return __generator(this, function (_d) {
|
|
45
45
|
switch (_d.label) {
|
|
46
46
|
case 0: return [4 /*yield*/, supabase.storage
|
|
47
47
|
.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
|
|
48
48
|
.upload(fileRef, blob, {
|
|
49
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
49
|
+
cacheControl: cacheControl || process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
50
50
|
contentType: contentType,
|
|
51
51
|
upsert: upsert,
|
|
52
52
|
})];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export interface UploadBlobToPublicSupabaseArgs {
|
|
2
2
|
blob: Blob;
|
|
3
|
+
cacheControl?: string;
|
|
3
4
|
contentType: string;
|
|
4
5
|
fileRef: string;
|
|
5
6
|
supabase: any;
|
|
6
7
|
upsert: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const uploadBlobToPublicSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadBlobToPublicSupabaseArgs) => Promise<{
|
|
9
|
+
export declare const uploadBlobToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPublicSupabaseArgs) => Promise<{
|
|
9
10
|
data: any;
|
|
10
11
|
error: any;
|
|
11
12
|
}>;
|
|
@@ -40,13 +40,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.uploadBlobToPublicSupabase = void 0;
|
|
41
41
|
var uploadBlobToPublicSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
42
|
var _c, data, error;
|
|
43
|
-
var blob = _b.blob, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
43
|
+
var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
44
44
|
return __generator(this, function (_d) {
|
|
45
45
|
switch (_d.label) {
|
|
46
46
|
case 0: return [4 /*yield*/, supabase.storage
|
|
47
47
|
.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
|
|
48
48
|
.upload(fileRef, blob, {
|
|
49
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
49
|
+
cacheControl: cacheControl || process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
50
50
|
contentType: contentType,
|
|
51
51
|
upsert: upsert,
|
|
52
52
|
})];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface UploadImageToPrivateSupabaseArgs {
|
|
2
|
+
cacheControl?: string;
|
|
2
3
|
blob: string;
|
|
3
4
|
contentType: string;
|
|
4
5
|
fileRef: string;
|
|
@@ -10,4 +11,4 @@ export interface PrivateReturn {
|
|
|
10
11
|
id: string;
|
|
11
12
|
path: string;
|
|
12
13
|
}
|
|
13
|
-
export declare const uploadImageToPrivateSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageToPrivateSupabaseArgs) => Promise<PrivateReturn>;
|
|
14
|
+
export declare const uploadImageToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPrivateSupabaseArgs) => Promise<PrivateReturn>;
|
|
@@ -41,7 +41,7 @@ exports.uploadImageToPrivateSupabase = void 0;
|
|
|
41
41
|
var remove_data_image_prefix_1 = require("./remove-data-image-prefix");
|
|
42
42
|
var uploadImageToPrivateSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
43
43
|
var base64StringWithoutPrefix, buffer, _c, data, error;
|
|
44
|
-
var blob = _b.blob, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
44
|
+
var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
45
45
|
return __generator(this, function (_d) {
|
|
46
46
|
switch (_d.label) {
|
|
47
47
|
case 0:
|
|
@@ -50,7 +50,7 @@ var uploadImageToPrivateSupabase = function (_a) { return __awaiter(void 0, [_a]
|
|
|
50
50
|
return [4 /*yield*/, supabase.storage
|
|
51
51
|
.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
|
|
52
52
|
.upload(fileRef, buffer, {
|
|
53
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
53
|
+
cacheControl: cacheControl || process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
54
54
|
contentType: contentType,
|
|
55
55
|
upsert: upsert,
|
|
56
56
|
})];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface UploadImageToPublicSupabaseArgs {
|
|
2
2
|
blob: string;
|
|
3
|
+
cacheControl?: string;
|
|
3
4
|
contentType: string;
|
|
4
5
|
fileRef: string;
|
|
5
6
|
supabase: any;
|
|
@@ -10,4 +11,4 @@ export interface PublicReturn {
|
|
|
10
11
|
id: string;
|
|
11
12
|
path: string;
|
|
12
13
|
}
|
|
13
|
-
export declare const uploadImageToPublicSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageToPublicSupabaseArgs) => Promise<PublicReturn>;
|
|
14
|
+
export declare const uploadImageToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPublicSupabaseArgs) => Promise<PublicReturn>;
|
|
@@ -41,7 +41,7 @@ exports.uploadImageToPublicSupabase = void 0;
|
|
|
41
41
|
var remove_data_image_prefix_1 = require("./remove-data-image-prefix");
|
|
42
42
|
var uploadImageToPublicSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
43
43
|
var base64StringWithoutPrefix, buffer, _c, data, error;
|
|
44
|
-
var blob = _b.blob, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
44
|
+
var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
|
|
45
45
|
return __generator(this, function (_d) {
|
|
46
46
|
switch (_d.label) {
|
|
47
47
|
case 0:
|
|
@@ -50,7 +50,7 @@ var uploadImageToPublicSupabase = function (_a) { return __awaiter(void 0, [_a],
|
|
|
50
50
|
return [4 /*yield*/, supabase.storage
|
|
51
51
|
.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
|
|
52
52
|
.upload(fileRef, buffer, {
|
|
53
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
53
|
+
cacheControl: cacheControl || process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
54
54
|
contentType: contentType,
|
|
55
55
|
upsert: upsert,
|
|
56
56
|
})];
|