@agentforge-io/sdk-server 4.40.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 +3 -0
- package/dist/client.js +2 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -1
- package/dist/resources/files.d.ts +39 -0
- package/dist/resources/files.js +25 -0
- package/dist/resources/templates.d.ts +33 -1
- package/dist/resources/templates.js +46 -1
- package/dist/types.d.ts +68 -0
- package/package.json +1 -1
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
|
@@ -3,7 +3,7 @@ export type { AgentForgeClientOptions, RequestOptions } from './client';
|
|
|
3
3
|
export { AgentForgeError, AgentForgeAuthError, AgentForgeNotFoundError, AgentForgeNetworkError, } from './errors';
|
|
4
4
|
export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
|
|
5
5
|
export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
|
|
6
|
-
export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, DirectOrderForm, CaseReceipt, CaseReceiptLine, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryQuote, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
6
|
+
export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, DirectOrderForm, CaseReceipt, CaseReceiptLine, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryQuote, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
7
7
|
export { AgentsResource } from './resources/agents';
|
|
8
8
|
export { AnalyticsResource } from './resources/analytics';
|
|
9
9
|
export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
|
|
@@ -15,7 +15,7 @@ export type { InboxChannelView } from './resources/connectors';
|
|
|
15
15
|
export { InboxResource } from './resources/inbox';
|
|
16
16
|
export { InstallationsResource } from './resources/installations';
|
|
17
17
|
export type { InstallAppInput } from './resources/installations';
|
|
18
|
-
export { TemplatesResource } from './resources/templates';
|
|
18
|
+
export { TemplatesResource, TemplateReviewsResource, TemplateReportsResource } from './resources/templates';
|
|
19
19
|
export type { ListTemplatesInput } from './resources/templates';
|
|
20
20
|
export { MarketplaceResource } from './resources/marketplace';
|
|
21
21
|
export type { ListMarketplaceCategoriesInput } from './resources/marketplace';
|
|
@@ -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.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; } });
|
|
@@ -63,6 +63,8 @@ var installations_1 = require("./resources/installations");
|
|
|
63
63
|
Object.defineProperty(exports, "InstallationsResource", { enumerable: true, get: function () { return installations_1.InstallationsResource; } });
|
|
64
64
|
var templates_1 = require("./resources/templates");
|
|
65
65
|
Object.defineProperty(exports, "TemplatesResource", { enumerable: true, get: function () { return templates_1.TemplatesResource; } });
|
|
66
|
+
Object.defineProperty(exports, "TemplateReviewsResource", { enumerable: true, get: function () { return templates_1.TemplateReviewsResource; } });
|
|
67
|
+
Object.defineProperty(exports, "TemplateReportsResource", { enumerable: true, get: function () { return templates_1.TemplateReportsResource; } });
|
|
66
68
|
var marketplace_1 = require("./resources/marketplace");
|
|
67
69
|
Object.defineProperty(exports, "MarketplaceResource", { enumerable: true, get: function () { return marketplace_1.MarketplaceResource; } });
|
|
68
70
|
var config_1 = require("./resources/config");
|
|
@@ -72,6 +74,8 @@ Object.defineProperty(exports, "PlacesResource", { enumerable: true, get: functi
|
|
|
72
74
|
var contacts_1 = require("./resources/contacts");
|
|
73
75
|
Object.defineProperty(exports, "ContactsResource", { enumerable: true, get: function () { return contacts_1.ContactsResource; } });
|
|
74
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; } });
|
|
75
79
|
var delivery_1 = require("./resources/delivery");
|
|
76
80
|
Object.defineProperty(exports, "DeliveryResource", { enumerable: true, get: function () { return delivery_1.DeliveryResource; } });
|
|
77
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { TemplateDetail, TemplateInstallResult, TemplateSummary } from '../types';
|
|
2
|
+
import type { CreateTemplateReportInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateDetail, TemplateInstallResult, TemplateReview, TemplateReviewsPage, TemplateSummary } from '../types';
|
|
3
3
|
export interface ListTemplatesInput {
|
|
4
4
|
kind?: 'agent' | 'team';
|
|
5
5
|
/** Every tag must match (AND), e.g. ['type:food']. */
|
|
@@ -22,6 +22,10 @@ export interface ListTemplatesInput {
|
|
|
22
22
|
}
|
|
23
23
|
export declare class TemplatesResource {
|
|
24
24
|
private readonly client;
|
|
25
|
+
/** AGF-PDK-TEMPLATE-PAGE. Reviews kept on the template, one per person. */
|
|
26
|
+
readonly reviews: TemplateReviewsResource;
|
|
27
|
+
/** AGF-PDK-TEMPLATE-PAGE. Problems reported about a template (private). */
|
|
28
|
+
readonly reports: TemplateReportsResource;
|
|
25
29
|
constructor(client: AgentForgeClient);
|
|
26
30
|
/** `GET /api/v1/templates` — templates visible to the caller's tenant. */
|
|
27
31
|
list(input?: ListTemplatesInput): Promise<TemplateSummary[]>;
|
|
@@ -32,3 +36,31 @@ export declare class TemplatesResource {
|
|
|
32
36
|
name?: string;
|
|
33
37
|
}): Promise<TemplateInstallResult>;
|
|
34
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* A template's reviews (AGF-PDK-TEMPLATE-PAGE). They live on the template, so
|
|
41
|
+
* the marketplace and every App show one list. An App writes as its user
|
|
42
|
+
* (`externalUserId`), from the tenant it acts in — which must have installed
|
|
43
|
+
* the template. One review per person and template; saving again edits it.
|
|
44
|
+
*/
|
|
45
|
+
export declare class TemplateReviewsResource {
|
|
46
|
+
private readonly client;
|
|
47
|
+
constructor(client: AgentForgeClient);
|
|
48
|
+
/** `GET /api/v1/templates/:id/reviews` — visible reviews + summary (+ `mine`). */
|
|
49
|
+
list(templateId: string, input?: ListTemplateReviewsInput): Promise<TemplateReviewsPage>;
|
|
50
|
+
/** `PUT /api/v1/templates/:id/reviews/mine` — create or edit. 403 `not_installed`, 400 on bad input. */
|
|
51
|
+
save(templateId: string, input: SaveTemplateReviewInput): Promise<TemplateReview>;
|
|
52
|
+
/** `DELETE /api/v1/templates/:id/reviews/mine` — no error when there was none. */
|
|
53
|
+
remove(templateId: string, input: {
|
|
54
|
+
externalUserId: string;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/** Report a problem with a template — a bug, inappropriate or misleading content… (AGF-PDK-TEMPLATE-PAGE). */
|
|
58
|
+
export declare class TemplateReportsResource {
|
|
59
|
+
private readonly client;
|
|
60
|
+
constructor(client: AgentForgeClient);
|
|
61
|
+
/** `POST /api/v1/templates/:id/reports`. 400 on bad input, 429 past 10 a day. */
|
|
62
|
+
create(templateId: string, input: CreateTemplateReportInput): Promise<{
|
|
63
|
+
id: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
// creates the template's config variables EMPTY (`configCreated`); fill them
|
|
14
14
|
// with `config.set`. Rows created by an App secret are owned by the App.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.TemplatesResource = void 0;
|
|
16
|
+
exports.TemplateReportsResource = exports.TemplateReviewsResource = exports.TemplatesResource = void 0;
|
|
17
17
|
class TemplatesResource {
|
|
18
18
|
constructor(client) {
|
|
19
19
|
this.client = client;
|
|
20
|
+
this.reviews = new TemplateReviewsResource(client);
|
|
21
|
+
this.reports = new TemplateReportsResource(client);
|
|
20
22
|
}
|
|
21
23
|
/** `GET /api/v1/templates` — templates visible to the caller's tenant. */
|
|
22
24
|
async list(input = {}) {
|
|
@@ -51,3 +53,46 @@ class TemplatesResource {
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
exports.TemplatesResource = TemplatesResource;
|
|
56
|
+
/**
|
|
57
|
+
* A template's reviews (AGF-PDK-TEMPLATE-PAGE). They live on the template, so
|
|
58
|
+
* the marketplace and every App show one list. An App writes as its user
|
|
59
|
+
* (`externalUserId`), from the tenant it acts in — which must have installed
|
|
60
|
+
* the template. One review per person and template; saving again edits it.
|
|
61
|
+
*/
|
|
62
|
+
class TemplateReviewsResource {
|
|
63
|
+
constructor(client) {
|
|
64
|
+
this.client = client;
|
|
65
|
+
}
|
|
66
|
+
/** `GET /api/v1/templates/:id/reviews` — visible reviews + summary (+ `mine`). */
|
|
67
|
+
async list(templateId, input = {}) {
|
|
68
|
+
const qs = new URLSearchParams();
|
|
69
|
+
if (input.externalUserId)
|
|
70
|
+
qs.set('externalUserId', input.externalUserId);
|
|
71
|
+
if (input.cursor)
|
|
72
|
+
qs.set('cursor', input.cursor);
|
|
73
|
+
if (input.limit !== undefined)
|
|
74
|
+
qs.set('limit', String(input.limit));
|
|
75
|
+
const query = qs.toString();
|
|
76
|
+
return this.client.request('GET', `/api/v1/templates/${encodeURIComponent(templateId)}/reviews${query ? `?${query}` : ''}`);
|
|
77
|
+
}
|
|
78
|
+
/** `PUT /api/v1/templates/:id/reviews/mine` — create or edit. 403 `not_installed`, 400 on bad input. */
|
|
79
|
+
async save(templateId, input) {
|
|
80
|
+
return this.client.request('PUT', `/api/v1/templates/${encodeURIComponent(templateId)}/reviews/mine`, input);
|
|
81
|
+
}
|
|
82
|
+
/** `DELETE /api/v1/templates/:id/reviews/mine` — no error when there was none. */
|
|
83
|
+
async remove(templateId, input) {
|
|
84
|
+
await this.client.request('DELETE', `/api/v1/templates/${encodeURIComponent(templateId)}/reviews/mine?externalUserId=${encodeURIComponent(input.externalUserId)}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.TemplateReviewsResource = TemplateReviewsResource;
|
|
88
|
+
/** Report a problem with a template — a bug, inappropriate or misleading content… (AGF-PDK-TEMPLATE-PAGE). */
|
|
89
|
+
class TemplateReportsResource {
|
|
90
|
+
constructor(client) {
|
|
91
|
+
this.client = client;
|
|
92
|
+
}
|
|
93
|
+
/** `POST /api/v1/templates/:id/reports`. 400 on bad input, 429 past 10 a day. */
|
|
94
|
+
async create(templateId, input) {
|
|
95
|
+
return this.client.request('POST', `/api/v1/templates/${encodeURIComponent(templateId)}/reports`, input);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.TemplateReportsResource = TemplateReportsResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -875,6 +875,11 @@ export interface TemplateSummary {
|
|
|
875
875
|
* Absent on platforms older than the field: treat as `false`. */
|
|
876
876
|
usesCatalog?: boolean;
|
|
877
877
|
installsCount: number;
|
|
878
|
+
/** AGF-PDK-TEMPLATE-PAGE. Average of the visible reviews (one decimal),
|
|
879
|
+
* null with none. Absent on platforms older than reviews. */
|
|
880
|
+
ratingAvg?: number | null;
|
|
881
|
+
/** Visible reviews. */
|
|
882
|
+
ratingCount?: number;
|
|
878
883
|
currentVersion: number;
|
|
879
884
|
/** One-time price in cents (USD). 0 / undefined = free. */
|
|
880
885
|
priceCents?: number;
|
|
@@ -894,6 +899,69 @@ export interface TemplateDetail extends TemplateSummary {
|
|
|
894
899
|
/** ISO timestamp of the last guide change. */
|
|
895
900
|
guideUpdatedAt?: string;
|
|
896
901
|
}
|
|
902
|
+
/** AGF-PDK-TEMPLATE-PAGE. A person's review of a template (one per person,
|
|
903
|
+
* editable). Never carries the reviewer's ids. */
|
|
904
|
+
export interface TemplateReview {
|
|
905
|
+
id: string;
|
|
906
|
+
/** 1–5. */
|
|
907
|
+
rating: number;
|
|
908
|
+
/** Plain text, or null for stars only. */
|
|
909
|
+
body: string | null;
|
|
910
|
+
reviewerName: string;
|
|
911
|
+
reviewerAvatarUrl: string | null;
|
|
912
|
+
/** Template version the review was last saved on. */
|
|
913
|
+
version: number;
|
|
914
|
+
createdAt: string;
|
|
915
|
+
updatedAt: string;
|
|
916
|
+
}
|
|
917
|
+
export interface TemplateRatingSummary {
|
|
918
|
+
/** One decimal; null with no reviews. */
|
|
919
|
+
avg: number | null;
|
|
920
|
+
count: number;
|
|
921
|
+
/** Reviews per star: index 0 = 1 star … 4 = 5 stars. */
|
|
922
|
+
distribution: [number, number, number, number, number];
|
|
923
|
+
}
|
|
924
|
+
/** `GET /api/v1/templates/:id/reviews`. */
|
|
925
|
+
export interface TemplateReviewsPage {
|
|
926
|
+
/** Visible reviews, newest first. */
|
|
927
|
+
items: TemplateReview[];
|
|
928
|
+
/** The `externalUserId`'s own review (also when hidden), or null. */
|
|
929
|
+
mine: TemplateReview | null;
|
|
930
|
+
summary: TemplateRatingSummary;
|
|
931
|
+
nextCursor: string | null;
|
|
932
|
+
}
|
|
933
|
+
export interface ListTemplateReviewsInput {
|
|
934
|
+
/** The App user whose own review comes back as `mine`. */
|
|
935
|
+
externalUserId?: string;
|
|
936
|
+
cursor?: string;
|
|
937
|
+
/** 1–50, default 20. */
|
|
938
|
+
limit?: number;
|
|
939
|
+
}
|
|
940
|
+
/** `PUT /api/v1/templates/:id/reviews/mine`. Only from a tenant that
|
|
941
|
+
* installed the template (403 `not_installed`). */
|
|
942
|
+
export interface SaveTemplateReviewInput {
|
|
943
|
+
/** The App user writing it (PoodleDeck: `member:<ownerId>`). */
|
|
944
|
+
externalUserId: string;
|
|
945
|
+
/** Whole number 1–5. */
|
|
946
|
+
rating: number;
|
|
947
|
+
/** ≤ 2,000 characters; empty or null = stars only. */
|
|
948
|
+
body?: string | null;
|
|
949
|
+
/** Shown name, ≤ 80. */
|
|
950
|
+
reviewerName: string;
|
|
951
|
+
/** https photo. */
|
|
952
|
+
reviewerAvatarUrl?: string | null;
|
|
953
|
+
}
|
|
954
|
+
/** AGF-PDK-TEMPLATE-PAGE. What kind of problem a report is about. */
|
|
955
|
+
export type TemplateReportKind = 'bug' | 'inappropriate' | 'misleading' | 'other';
|
|
956
|
+
/** `POST /api/v1/templates/:id/reports` — private to the author and admins. 429 past 10 a day. */
|
|
957
|
+
export interface CreateTemplateReportInput {
|
|
958
|
+
/** The App user sending it. */
|
|
959
|
+
externalUserId: string;
|
|
960
|
+
kind: TemplateReportKind;
|
|
961
|
+
/** What happened, ≤ 2,000 characters. */
|
|
962
|
+
note: string;
|
|
963
|
+
reporterName?: string | null;
|
|
964
|
+
}
|
|
897
965
|
/** AGF-MARKET-LISTING. Languages a listing can be written in. */
|
|
898
966
|
export type MarketplaceLocale = 'es' | 'en';
|
|
899
967
|
/** `industry` = what the business is; `use_case` = what the template does. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
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",
|