@agentforge-io/sdk-server 4.41.0 → 4.43.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/client.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ConnectorsResource } from './resources/connectors';
6
6
  import { InboxResource } from './resources/inbox';
7
7
  import { InstallationsResource } from './resources/installations';
8
8
  import { ContactsResource } from './resources/contacts';
9
+ import { FilesResource } from './resources/files';
9
10
  import { WebhookResource } from './resources/webhook';
10
11
  import { ProvisioningResource } from './resources/provisioning';
11
12
  import { SecretsResource } from './resources/secrets';
@@ -94,6 +95,8 @@ export declare class AgentForgeClient {
94
95
  readonly installations: InstallationsResource;
95
96
  /** AGF-CUSTOMER-ACCOUNTS — the business's contacts for the App's end users. */
96
97
  readonly contacts: ContactsResource;
98
+ /** AGF-TEAM-CHAT — files an App's people share inside a tenant (signed PUT + delete). */
99
+ readonly files: FilesResource;
97
100
  /** Where the platform sends this App its events (AGF-APP-WEBHOOKS). */
98
101
  readonly webhook: WebhookResource;
99
102
  readonly provisioning: ProvisioningResource;
package/dist/client.js CHANGED
@@ -28,6 +28,7 @@ const connectors_1 = require("./resources/connectors");
28
28
  const inbox_1 = require("./resources/inbox");
29
29
  const installations_1 = require("./resources/installations");
30
30
  const contacts_1 = require("./resources/contacts");
31
+ const files_1 = require("./resources/files");
31
32
  const webhook_1 = require("./resources/webhook");
32
33
  const provisioning_1 = require("./resources/provisioning");
33
34
  const secrets_1 = require("./resources/secrets");
@@ -75,6 +76,7 @@ class AgentForgeClient {
75
76
  this.inbox = new inbox_1.InboxResource(this);
76
77
  this.installations = new installations_1.InstallationsResource(this);
77
78
  this.contacts = new contacts_1.ContactsResource(this);
79
+ this.files = new files_1.FilesResource(this);
78
80
  this.webhook = new webhook_1.WebhookResource(this);
79
81
  this.provisioning = new provisioning_1.ProvisioningResource(this);
80
82
  this.secrets = new secrets_1.SecretsResource(this);
package/dist/index.d.ts CHANGED
@@ -23,6 +23,8 @@ export { TenantConfigResource } from './resources/config';
23
23
  export { PlacesResource } from './resources/places';
24
24
  export { ContactsResource, ContactVerificationResource } from './resources/contacts';
25
25
  export type { ContactVerificationChannel, LinkContactInput, LinkContactResult, AppContact, ContactAvatarUploadTarget, ClaimContactInput, ClaimContactResult, StartVerificationInput, StartVerificationResult, ConfirmVerificationInput, ConfirmVerificationResult, } from './resources/contacts';
26
+ export { FilesResource } from './resources/files';
27
+ export type { AppFileKind, SignAppFileInput, AppFileUploadTarget } from './resources/files';
26
28
  export { DeliveryResource } from './resources/delivery';
27
29
  export { CasesResource } from './resources/cases';
28
30
  export { BusinessRolesResource } from './resources/business-roles';
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@
28
28
  // const payload = af.tools.verifyCallback({ rawBody, signatureHeader, secretPlaintext });
29
29
  // await af.tools.respondToCallback({ resultUrl: payload.resultUrl, tenantId: payload.tenantId, secret, result });
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogUnitsResource = exports.CatalogOptionGroupsResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogProductsResource = exports.CatalogCategoriesResource = exports.CatalogResource = exports.BusinessRolesResource = exports.CasesResource = exports.DeliveryResource = exports.ContactVerificationResource = exports.ContactsResource = exports.PlacesResource = exports.TenantConfigResource = exports.MarketplaceResource = exports.TemplateReportsResource = exports.TemplateReviewsResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.parseGoogleSheetsPickerResult = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.WebhookResource = exports.verifyToolCallbackSignature = exports.verifyAppWebhook = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.APP_WEBHOOK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
31
+ exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogUnitsResource = exports.CatalogOptionGroupsResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogProductsResource = exports.CatalogCategoriesResource = exports.CatalogResource = exports.BusinessRolesResource = exports.CasesResource = exports.DeliveryResource = exports.FilesResource = exports.ContactVerificationResource = exports.ContactsResource = exports.PlacesResource = exports.TenantConfigResource = exports.MarketplaceResource = exports.TemplateReportsResource = exports.TemplateReviewsResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.parseGoogleSheetsPickerResult = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.WebhookResource = exports.verifyToolCallbackSignature = exports.verifyAppWebhook = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.APP_WEBHOOK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
32
32
  var client_1 = require("./client");
33
33
  Object.defineProperty(exports, "AgentForgeClient", { enumerable: true, get: function () { return client_1.AgentForgeClient; } });
34
34
  Object.defineProperty(exports, "INSTALLED_TENANT_HEADER", { enumerable: true, get: function () { return client_1.INSTALLED_TENANT_HEADER; } });
@@ -74,6 +74,8 @@ Object.defineProperty(exports, "PlacesResource", { enumerable: true, get: functi
74
74
  var contacts_1 = require("./resources/contacts");
75
75
  Object.defineProperty(exports, "ContactsResource", { enumerable: true, get: function () { return contacts_1.ContactsResource; } });
76
76
  Object.defineProperty(exports, "ContactVerificationResource", { enumerable: true, get: function () { return contacts_1.ContactVerificationResource; } });
77
+ var files_1 = require("./resources/files");
78
+ Object.defineProperty(exports, "FilesResource", { enumerable: true, get: function () { return files_1.FilesResource; } });
77
79
  var delivery_1 = require("./resources/delivery");
78
80
  Object.defineProperty(exports, "DeliveryResource", { enumerable: true, get: function () { return delivery_1.DeliveryResource; } });
79
81
  var cases_1 = require("./resources/cases");
@@ -0,0 +1,39 @@
1
+ import type { AgentForgeClient } from '../client';
2
+ /** AGF-TEAM-CHAT: what an App's people may share, by kind (caps: image 10 MB, video 50 MB, file 20 MB). */
3
+ export type AppFileKind = 'image' | 'video' | 'file';
4
+ export interface SignAppFileInput {
5
+ kind: AppFileKind;
6
+ /** The MIME the PUT will declare (must belong to the kind: jpeg/png/webp/gif/heic · mp4/mov/webm · pdf/office/csv/txt/zip). */
7
+ contentType: string;
8
+ /** Bytes; checked against the kind's cap before signing. */
9
+ contentLength?: number;
10
+ }
11
+ export interface AppFileUploadTarget {
12
+ /** PUT the bytes here with the same `Content-Type`. Short-lived. */
13
+ uploadUrl: string;
14
+ /** The file's URL once uploaded. */
15
+ publicUrl: string;
16
+ /** Keep it: `files.delete(key)` removes the file. */
17
+ key: string;
18
+ expiresInSeconds: number;
19
+ kind: AppFileKind;
20
+ maxBytes: number;
21
+ }
22
+ /**
23
+ * AGF-TEAM-CHAT — files an App's people share inside a tenant (a photo, video
24
+ * or document posted in a business's team chat). Use it on
25
+ * `af.forTenant(tenantId)`: the key is scoped to the App in that tenant.
26
+ */
27
+ export declare class FilesResource {
28
+ private readonly client;
29
+ constructor(client: AgentForgeClient);
30
+ /**
31
+ * `POST /api/v1/files/sign-upload` — a signed PUT. Errors: 400 `invalid` /
32
+ * `unsupported_type`, 413 `too_large`, 501 `not_configured`.
33
+ */
34
+ signUpload(input: SignAppFileInput): Promise<AppFileUploadTarget>;
35
+ /** `POST /api/v1/files/delete` — `deleted: false` when storage could not delete it (never throws for that). */
36
+ delete(key: string): Promise<{
37
+ deleted: boolean;
38
+ }>;
39
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FilesResource = void 0;
4
+ /**
5
+ * AGF-TEAM-CHAT — files an App's people share inside a tenant (a photo, video
6
+ * or document posted in a business's team chat). Use it on
7
+ * `af.forTenant(tenantId)`: the key is scoped to the App in that tenant.
8
+ */
9
+ class FilesResource {
10
+ constructor(client) {
11
+ this.client = client;
12
+ }
13
+ /**
14
+ * `POST /api/v1/files/sign-upload` — a signed PUT. Errors: 400 `invalid` /
15
+ * `unsupported_type`, 413 `too_large`, 501 `not_configured`.
16
+ */
17
+ async signUpload(input) {
18
+ return this.client.request('POST', '/api/v1/files/sign-upload', input);
19
+ }
20
+ /** `POST /api/v1/files/delete` — `deleted: false` when storage could not delete it (never throws for that). */
21
+ async delete(key) {
22
+ return this.client.request('POST', '/api/v1/files/delete', { key });
23
+ }
24
+ }
25
+ exports.FilesResource = FilesResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.41.0",
3
+ "version": "4.43.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",