@agentforge-io/sdk-server 4.41.0 → 4.44.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 +3 -1
- package/dist/index.js +3 -1
- package/dist/resources/cases.d.ts +19 -1
- package/dist/resources/cases.js +32 -0
- package/dist/resources/files.d.ts +39 -0
- package/dist/resources/files.js +25 -0
- package/dist/types.d.ts +86 -1
- 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, 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';
|
|
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, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogBookingRule, 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';
|
|
@@ -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");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectOrderInput, DirectOrderForm, ListCasesInput } from '../types';
|
|
2
|
+
import type { CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput } from '../types';
|
|
3
3
|
export declare class CasesResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
@@ -49,6 +49,24 @@ export declare class CasesResource {
|
|
|
49
49
|
* 400 for a bad order or missing fields, 409 when a product lacks stock.
|
|
50
50
|
*/
|
|
51
51
|
createDirect(input: CreateDirectOrderInput): Promise<CaseView>;
|
|
52
|
+
/**
|
|
53
|
+
* `POST /api/v1/cases/bookings` — AGF-AGENDA: a booking from your App's agenda
|
|
54
|
+
* (hold the time in your own ledger first). Created sent (`submitted`), or
|
|
55
|
+
* `accepted` at once with `confirmation: 'instant'`, with receipt and events like
|
|
56
|
+
* a direct order. 400 when the service is not bookable or the span is not its
|
|
57
|
+
* duration. A retried `idempotencyKey` returns the same booking.
|
|
58
|
+
*/
|
|
59
|
+
createDirectBooking(input: CreateDirectBookingInput): Promise<CaseView>;
|
|
60
|
+
/**
|
|
61
|
+
* `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
|
|
62
|
+
* open request (your member reference), or null to leave it unassigned.
|
|
63
|
+
* `memberName` updates a booking's «Profesional».
|
|
64
|
+
*/
|
|
65
|
+
assign(caseId: string, assigneeRef: string | null, opts?: {
|
|
66
|
+
memberName?: string;
|
|
67
|
+
}): Promise<CaseView>;
|
|
68
|
+
/** `POST /api/v1/cases/:id/slot` — AGF-AGENDA: moves a booking to a time you already hold. */
|
|
69
|
+
updateSlot(caseId: string, input: MoveCaseSlotInput): Promise<CaseView>;
|
|
52
70
|
/**
|
|
53
71
|
* `POST /api/v1/cases/:id/payment` — AGF-PAYMENT-ACCOUNTS: the business moves the
|
|
54
72
|
* payment: `paid` (confirmed, or cash received), `rejected` (did not arrive),
|
package/dist/resources/cases.js
CHANGED
|
@@ -22,6 +22,13 @@ class CasesResource {
|
|
|
22
22
|
qs.set('since', input.since instanceof Date ? input.since.toISOString() : input.since);
|
|
23
23
|
if (input.limit !== undefined)
|
|
24
24
|
qs.set('limit', String(input.limit));
|
|
25
|
+
const at = (v) => (v instanceof Date ? v.toISOString() : v);
|
|
26
|
+
if (input.slotFrom)
|
|
27
|
+
qs.set('slotFrom', at(input.slotFrom));
|
|
28
|
+
if (input.slotTo)
|
|
29
|
+
qs.set('slotTo', at(input.slotTo));
|
|
30
|
+
if (input.assignee)
|
|
31
|
+
qs.set('assignee', input.assignee);
|
|
25
32
|
const q = qs.toString();
|
|
26
33
|
return (await this.client.request('GET', `/api/v1/cases${q ? `?${q}` : ''}`)).items;
|
|
27
34
|
}
|
|
@@ -82,6 +89,31 @@ class CasesResource {
|
|
|
82
89
|
async createDirect(input) {
|
|
83
90
|
return this.client.request('POST', '/api/v1/cases/direct', input);
|
|
84
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* `POST /api/v1/cases/bookings` — AGF-AGENDA: a booking from your App's agenda
|
|
94
|
+
* (hold the time in your own ledger first). Created sent (`submitted`), or
|
|
95
|
+
* `accepted` at once with `confirmation: 'instant'`, with receipt and events like
|
|
96
|
+
* a direct order. 400 when the service is not bookable or the span is not its
|
|
97
|
+
* duration. A retried `idempotencyKey` returns the same booking.
|
|
98
|
+
*/
|
|
99
|
+
async createDirectBooking(input) {
|
|
100
|
+
return this.client.request('POST', '/api/v1/cases/bookings', input);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
|
|
104
|
+
* open request (your member reference), or null to leave it unassigned.
|
|
105
|
+
* `memberName` updates a booking's «Profesional».
|
|
106
|
+
*/
|
|
107
|
+
async assign(caseId, assigneeRef, opts = {}) {
|
|
108
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/assign`, {
|
|
109
|
+
assigneeRef,
|
|
110
|
+
...(opts.memberName ? { memberName: opts.memberName } : {}),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** `POST /api/v1/cases/:id/slot` — AGF-AGENDA: moves a booking to a time you already hold. */
|
|
114
|
+
async updateSlot(caseId, input) {
|
|
115
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/slot`, input);
|
|
116
|
+
}
|
|
85
117
|
/**
|
|
86
118
|
* `POST /api/v1/cases/:id/payment` — AGF-PAYMENT-ACCOUNTS: the business moves the
|
|
87
119
|
* payment: `paid` (confirmed, or cash received), `rejected` (did not arrive),
|
|
@@ -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/dist/types.d.ts
CHANGED
|
@@ -802,6 +802,13 @@ export type TeamProfileBlock = {
|
|
|
802
802
|
kind: 'catalog';
|
|
803
803
|
catalogId: string;
|
|
804
804
|
[field: string]: unknown;
|
|
805
|
+
}
|
|
806
|
+
/** AGF-AGENDA — the business's agenda: free times of its bookable services (the host computes them). */
|
|
807
|
+
| {
|
|
808
|
+
kind: 'agenda';
|
|
809
|
+
serviceIds?: string[];
|
|
810
|
+
customerPicksMember?: boolean;
|
|
811
|
+
layout?: 'chips' | 'list';
|
|
805
812
|
});
|
|
806
813
|
/** `GET /api/v1/teams/:id` — the team with its page settings, and its members. */
|
|
807
814
|
export interface TeamDetail {
|
|
@@ -874,6 +881,9 @@ export interface TemplateSummary {
|
|
|
874
881
|
* ask the owner for products (`af.catalog`) instead of a product field.
|
|
875
882
|
* Absent on platforms older than the field: treat as `false`. */
|
|
876
883
|
usesCatalog?: boolean;
|
|
884
|
+
/** AGF-AGENDA — the template books times (an enabled `agenda` block or a case type marked
|
|
885
|
+
* `booking`); the host should give the business an agenda. Always derived. Absent on older platforms: `false`. */
|
|
886
|
+
usesAgenda?: boolean;
|
|
877
887
|
installsCount: number;
|
|
878
888
|
/** AGF-PDK-TEMPLATE-PAGE. Average of the visible reviews (one decimal),
|
|
879
889
|
* null with none. Absent on platforms older than reviews. */
|
|
@@ -1118,6 +1128,8 @@ export interface CatalogProduct {
|
|
|
1118
1128
|
/** AGF-UNITS U2 — how it is sold; null = by unit. Sold by measure, `stock` counts the unit
|
|
1119
1129
|
* kind's base (g, ml, cm): divide by the unit's `base` to read it in the product's unit. */
|
|
1120
1130
|
saleRule?: CatalogSaleRule | null;
|
|
1131
|
+
/** AGF-AGENDA — a service's duration and buffer; null = not bookable. */
|
|
1132
|
+
booking?: CatalogBookingRule | null;
|
|
1121
1133
|
lastSoldAt?: string | null;
|
|
1122
1134
|
demandCount: number;
|
|
1123
1135
|
createdAt: string;
|
|
@@ -1143,6 +1155,9 @@ export interface CreateCatalogProductInput {
|
|
|
1143
1155
|
attributes?: Record<string, unknown>;
|
|
1144
1156
|
availability?: CatalogAvailability | null;
|
|
1145
1157
|
lockedFields?: CatalogLockableField[];
|
|
1158
|
+
/** AGF-AGENDA — a service's `{ durationMinutes, bufferMinutes? }`; null makes it not bookable.
|
|
1159
|
+
* Only `kind: 'service'` (400 NOT_A_SERVICE), 5–720 and 0–120 minutes (400 INVALID_BOOKING). */
|
|
1160
|
+
booking?: CatalogBookingRule | null;
|
|
1146
1161
|
}
|
|
1147
1162
|
export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductInput> {
|
|
1148
1163
|
sortOrder?: number;
|
|
@@ -1152,6 +1167,11 @@ export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductI
|
|
|
1152
1167
|
* Switching converts the stock; a measure needs a weight/volume/length/area/time unit. */
|
|
1153
1168
|
saleRule?: CatalogSaleRule;
|
|
1154
1169
|
}
|
|
1170
|
+
/** AGF-AGENDA — how long a bookable service takes, and the time after it before the next. */
|
|
1171
|
+
export interface CatalogBookingRule {
|
|
1172
|
+
durationMinutes: number;
|
|
1173
|
+
bufferMinutes?: number;
|
|
1174
|
+
}
|
|
1155
1175
|
/** AGF-UNITS U2 — how a product is sold. */
|
|
1156
1176
|
export interface CatalogSaleRule {
|
|
1157
1177
|
by: 'unit' | 'measure';
|
|
@@ -1993,7 +2013,8 @@ export interface CaseType {
|
|
|
1993
2013
|
* `submitted` (with the business) → `accepted` → the type's business states →
|
|
1994
2014
|
* `completed` | `cancelled` | `rejected` | `abandoned`.
|
|
1995
2015
|
*/
|
|
1996
|
-
|
|
2016
|
+
/** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
|
|
2017
|
+
export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
|
|
1997
2018
|
export interface CaseView {
|
|
1998
2019
|
id: string;
|
|
1999
2020
|
/** Per workspace, sequential (ordering). People read `code`. */
|
|
@@ -2055,6 +2076,12 @@ export interface CaseView {
|
|
|
2055
2076
|
} | null;
|
|
2056
2077
|
/** AGF-PAYMENT-ACCOUNTS — how it is paid: null before the business took it (or closed undone with nothing chosen). */
|
|
2057
2078
|
payment: CasePayment | null;
|
|
2079
|
+
/** AGF-AGENDA — who of the business attends it: your member reference (set with `cases.assign`). */
|
|
2080
|
+
assigneeRef: string | null;
|
|
2081
|
+
/** AGF-AGENDA — the time a booking holds, and how it reads («lunes, 9 de noviembre, 10:00–10:45»). */
|
|
2082
|
+
slot: (CaseSlot & {
|
|
2083
|
+
label: string;
|
|
2084
|
+
}) | null;
|
|
2058
2085
|
openedAt: string;
|
|
2059
2086
|
reviewedAt: string | null;
|
|
2060
2087
|
submittedAt: string | null;
|
|
@@ -2270,6 +2297,64 @@ export interface ListCasesInput {
|
|
|
2270
2297
|
since?: string | Date;
|
|
2271
2298
|
/** 1–200, default 50. */
|
|
2272
2299
|
limit?: number;
|
|
2300
|
+
/** AGF-AGENDA — bookings whose time starts in [slotFrom, slotTo), earliest first. */
|
|
2301
|
+
slotFrom?: string | Date;
|
|
2302
|
+
slotTo?: string | Date;
|
|
2303
|
+
/** AGF-AGENDA — one member's requests (your reference), or `none` for unassigned ones. */
|
|
2304
|
+
assignee?: string;
|
|
2305
|
+
}
|
|
2306
|
+
/** The time a booking holds (a snapshot: your App's agenda decides what is free). */
|
|
2307
|
+
export interface CaseSlot {
|
|
2308
|
+
/** ISO instants. */
|
|
2309
|
+
startsAt: string;
|
|
2310
|
+
endsAt: string;
|
|
2311
|
+
/** IANA zone the business reads it in. */
|
|
2312
|
+
timezone: string;
|
|
2313
|
+
serviceId?: string;
|
|
2314
|
+
serviceName?: string;
|
|
2315
|
+
/** Who attends, as you named them when you booked. */
|
|
2316
|
+
memberName?: string;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* `POST /api/v1/cases/bookings` — a booking from your App's agenda. Reserve the
|
|
2320
|
+
* time in your own ledger first; the platform checks the service is a bookable
|
|
2321
|
+
* one of the business (`booking.durationMinutes`) and that the span is exactly
|
|
2322
|
+
* that duration.
|
|
2323
|
+
*/
|
|
2324
|
+
export interface CreateDirectBookingInput {
|
|
2325
|
+
customer: {
|
|
2326
|
+
ref: string;
|
|
2327
|
+
name: string;
|
|
2328
|
+
phone: string;
|
|
2329
|
+
};
|
|
2330
|
+
/** A catalog service of the business with a `booking` rule. */
|
|
2331
|
+
serviceId: string;
|
|
2332
|
+
/** ISO instants with their offset (Z or ±hh:mm). */
|
|
2333
|
+
startsAt: string;
|
|
2334
|
+
endsAt: string;
|
|
2335
|
+
/** IANA zone (the business's opening hours' zone). */
|
|
2336
|
+
timezone: string;
|
|
2337
|
+
/** Your member reference of who attends, and their name for the request («Profesional»). */
|
|
2338
|
+
assigneeRef?: string;
|
|
2339
|
+
assigneeName?: string;
|
|
2340
|
+
/** `review` (default): the business accepts it; `instant`: accepted as booked. */
|
|
2341
|
+
confirmation?: 'review' | 'instant';
|
|
2342
|
+
/** The booking type's other fields (notas…), by key. */
|
|
2343
|
+
fields?: Record<string, unknown>;
|
|
2344
|
+
/** The team's booking type; default: its first type marked `booking`, else the built-in «cita». */
|
|
2345
|
+
type?: string;
|
|
2346
|
+
/** The customer's chat conversation, when booked from the chat. */
|
|
2347
|
+
conversationId?: string;
|
|
2348
|
+
/** Same key → same booking. 8–80 of [A-Za-z0-9_.:-]. */
|
|
2349
|
+
idempotencyKey: string;
|
|
2350
|
+
}
|
|
2351
|
+
/** `POST /api/v1/cases/:id/slot` — the new time (you already hold it), optionally another member. */
|
|
2352
|
+
export interface MoveCaseSlotInput {
|
|
2353
|
+
startsAt: string;
|
|
2354
|
+
endsAt: string;
|
|
2355
|
+
timezone?: string;
|
|
2356
|
+
assigneeRef?: string | null;
|
|
2357
|
+
assigneeName?: string;
|
|
2273
2358
|
}
|
|
2274
2359
|
export type AppWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed';
|
|
2275
2360
|
export interface AppWebhook {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.44.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",
|