@almadar/integrations 2.28.0 → 2.29.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/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as IntegrationLogger, c as IntegrationErrorCode, a as IntegrationConfig, B as BaseIntegration, d as IntegrationFactory, g as IntegrationParams, h as IntegrationResult, I as IntegrationCallContext } from './BaseIntegration-C_5q54DM.js';
|
|
2
2
|
export { b as IntegrationError, f as IntegrationParamValue, V as ValidationError, i as ValidationResult, j as getIntegrationFactory, r as resetIntegrationFactory, v as validateParams } from './BaseIntegration-C_5q54DM.js';
|
|
3
|
-
import { e as CredentialStore, d as CredentialPersistence, H as HookDeclaration } from './store-
|
|
4
|
-
export { A as ArxivActions, C as CLIActions, a as CREDENTIAL_ENTITY_TYPE, b as CREDENTIAL_MASTER_KEY_ENV, c as CredentialEntry, D as DatabaseActions, f as DatabaseDriver, g as DatabaseQueryParamValue, h as DatabaseQueryParams, i as DatabaseQueryResult, j as DatabaseRow, k as DeepAgentActions, l as DockerActions, E as EmailActions, G as GitHubActions, I as IconifyActions, m as IntegrationActionName, n as IntegrationContracts, o as IntegrationName, L as LLMIntegrationActions, M as MLActions, O as OAuthActions, p as OtelActions, Q as QueueActions, R as RedisActions, S as StorageActions, q as StripeActions, T as TwilioActions, W as WebhookActions, r as WikimediaActions, Y as YouTubeActions, s as serviceHooks } from './store-
|
|
3
|
+
import { e as CredentialStore, d as CredentialPersistence, H as HookDeclaration } from './store-eq1-GfDi.js';
|
|
4
|
+
export { A as ArxivActions, C as CLIActions, a as CREDENTIAL_ENTITY_TYPE, b as CREDENTIAL_MASTER_KEY_ENV, c as CredentialEntry, D as DatabaseActions, f as DatabaseDriver, g as DatabaseQueryParamValue, h as DatabaseQueryParams, i as DatabaseQueryResult, j as DatabaseRow, k as DeepAgentActions, l as DockerActions, E as EmailActions, G as GitHubActions, I as IconifyActions, m as IntegrationActionName, n as IntegrationContracts, o as IntegrationName, L as LLMIntegrationActions, M as MLActions, O as OAuthActions, p as OtelActions, Q as QueueActions, R as RedisActions, S as StorageActions, q as StripeActions, T as TwilioActions, W as WebhookActions, r as WikimediaActions, Y as YouTubeActions, s as serviceHooks } from './store-eq1-GfDi.js';
|
|
5
5
|
import { LogMeta, EntityRow, EventPayload } from '@almadar/core';
|
|
6
6
|
export { GitHubIntegration } from './integrations/github/index.js';
|
|
7
7
|
|
|
@@ -903,6 +903,14 @@ declare class StorageIntegration extends BaseIntegration {
|
|
|
903
903
|
private resolveUpload;
|
|
904
904
|
private publicUrl;
|
|
905
905
|
private upload;
|
|
906
|
+
/**
|
|
907
|
+
* Upload a whole UploadDropZone batch in one action — the FSM-friendly
|
|
908
|
+
* shape for multi-file atoms (std-image-upload-multi): one call-service
|
|
909
|
+
* arm in, one bulk-persistable `items` array out. Each item carries
|
|
910
|
+
* id/url plus the name/sizeBytes/mimeType columns an uploaded-file row
|
|
911
|
+
* declares.
|
|
912
|
+
*/
|
|
913
|
+
private uploadMany;
|
|
906
914
|
private download;
|
|
907
915
|
private list;
|
|
908
916
|
private deleteObject;
|
package/dist/index.js
CHANGED
|
@@ -4710,6 +4710,9 @@ var StorageIntegration = class extends BaseIntegration {
|
|
|
4710
4710
|
case "upload":
|
|
4711
4711
|
data = await this.executeWithRetry(() => this.upload(params));
|
|
4712
4712
|
break;
|
|
4713
|
+
case "uploadMany":
|
|
4714
|
+
data = await this.executeWithRetry(() => this.uploadMany(params));
|
|
4715
|
+
break;
|
|
4713
4716
|
case "download":
|
|
4714
4717
|
data = await this.executeWithRetry(() => this.download(params));
|
|
4715
4718
|
break;
|
|
@@ -4821,9 +4824,41 @@ var StorageIntegration = class extends BaseIntegration {
|
|
|
4821
4824
|
etag
|
|
4822
4825
|
});
|
|
4823
4826
|
}
|
|
4824
|
-
const url = acl === "public-read" ? this.publicUrl(bucket, key) : (await this.signUrl(bucket, key, "get", 3600)).url;
|
|
4827
|
+
const url = this.s3 ? acl === "public-read" ? this.publicUrl(bucket, key) : (await this.signUrl(bucket, key, "get", 3600)).url : `data:${contentType};base64,${bytes.toString("base64")}`;
|
|
4825
4828
|
return { key, bucket, size: bytes.length, etag, id: key, url };
|
|
4826
4829
|
}
|
|
4830
|
+
/**
|
|
4831
|
+
* Upload a whole UploadDropZone batch in one action — the FSM-friendly
|
|
4832
|
+
* shape for multi-file atoms (std-image-upload-multi): one call-service
|
|
4833
|
+
* arm in, one bulk-persistable `items` array out. Each item carries
|
|
4834
|
+
* id/url plus the name/sizeBytes/mimeType columns an uploaded-file row
|
|
4835
|
+
* declares.
|
|
4836
|
+
*/
|
|
4837
|
+
async uploadMany(params) {
|
|
4838
|
+
const rawFiles = Array.isArray(params.files) ? params.files : [];
|
|
4839
|
+
const files = rawFiles.map((f) => toFilePayload(f)).filter((f) => f !== null);
|
|
4840
|
+
if (files.length === 0) {
|
|
4841
|
+
throw new Error("uploadMany requires a non-empty `files` array (UploadDropZone batch shape)");
|
|
4842
|
+
}
|
|
4843
|
+
const items = [];
|
|
4844
|
+
for (const file of files) {
|
|
4845
|
+
const result = await this.upload({
|
|
4846
|
+
bucket: params.bucket,
|
|
4847
|
+
file: { name: file.name, size: file.size, type: file.type, content: file.content },
|
|
4848
|
+
acl: params.acl,
|
|
4849
|
+
maxSize: params.maxSize
|
|
4850
|
+
});
|
|
4851
|
+
items.push({
|
|
4852
|
+
id: result.id,
|
|
4853
|
+
key: result.key,
|
|
4854
|
+
url: result.url,
|
|
4855
|
+
name: file.name,
|
|
4856
|
+
sizeBytes: file.size,
|
|
4857
|
+
mimeType: file.type
|
|
4858
|
+
});
|
|
4859
|
+
}
|
|
4860
|
+
return { items, count: items.length };
|
|
4861
|
+
}
|
|
4827
4862
|
async download(params) {
|
|
4828
4863
|
const bucket = this.bucketOf(params);
|
|
4829
4864
|
const key = params.key;
|