node-autotask 0.34.0 → 0.37.1
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/CHANGELOG.md +58 -1
- package/MCP_TOOL_CATALOG.json +26 -9
- package/MCP_TOOL_MANIFEST.md +14 -13
- package/N8N_MCP_MANIFEST.json +5 -5
- package/N8N_MCP_MANIFEST.md +4 -4
- package/README.md +12 -5
- package/capabilities.json +3097 -1344
- package/capabilities.schema.json +4 -0
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.d.cts +2 -0
- package/dist/capabilities.d.ts +2 -0
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-P6YN2POI.cjs → chunk-25VGFT5M.cjs} +143 -143
- package/dist/{chunk-EZKM4HQ6.js → chunk-7IADHNBZ.js} +8486 -3122
- package/dist/{chunk-RDFL5QYE.js → chunk-7WI7FBPB.js} +12 -12
- package/dist/{chunk-FOOHJBPP.cjs → chunk-HBYKTXN3.cjs} +3096 -1343
- package/dist/{chunk-4MUBUSTL.js → chunk-KQ6HMBB4.js} +3096 -1343
- package/dist/{chunk-DKJP73FX.cjs → chunk-PFFW4DIK.cjs} +4657 -9597
- package/dist/{chunk-6ADFCU3I.js → chunk-PFJAMFUL.js} +4456 -9396
- package/dist/{chunk-GDQ4QM7Q.cjs → chunk-TBFXRNNE.cjs} +8452 -3088
- package/dist/{index-ByMU8IC2.d.ts → index-BDqw377y.d.ts} +117 -14
- package/dist/{index-Dx4-zpDo.d.cts → index-CqepIQfp.d.cts} +117 -14
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -14
- package/dist/operations/index.cjs +828 -137
- package/dist/operations/index.d.cts +145 -5
- package/dist/operations/index.d.ts +145 -5
- package/dist/operations/index.js +697 -6
- package/dist/pool.cjs +9 -9
- package/dist/pool.d.cts +1 -1
- package/dist/pool.d.ts +1 -1
- package/dist/pool.js +4 -4
- package/dist/resources/index.cjs +5 -4
- package/dist/resources/index.d.cts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +14 -13
- package/docs/API.md +331 -13
- package/docs/LIVE-TESTING.md +11 -11
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as AutotaskClient,
|
|
2
|
-
export {
|
|
1
|
+
import { a as AutotaskClient, eF as BlindSurfaceInfo, eG as RelationshipResource, eH as BlindSurfaceInventory, eI as BlindSurfaceRow, eJ as CreateGuidanceValueRequirement, eK as CreateGuidanceRow, eL as CreateBlockerKind, eM as CreateGuidanceReport, Z as ZoneName, eN as FieldCacheKind, k as AutotaskConfigError } from '../index-CqepIQfp.cjs';
|
|
2
|
+
export { eO as FIELD_CACHE_KINDS } from '../index-CqepIQfp.cjs';
|
|
3
3
|
import { I as Identifier, cX as EmptyReasonInfo, e9 as PickListValue, a as FilterCondition } from '../index-m-7fOwFl.cjs';
|
|
4
4
|
export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-m-7fOwFl.cjs';
|
|
5
5
|
import { CapabilityRecord } from '../capabilities.cjs';
|
|
@@ -287,6 +287,146 @@ interface AggregateResult {
|
|
|
287
287
|
*/
|
|
288
288
|
declare function aggregate(client: AutotaskClient, operation: string, filter: unknown, opts?: AggregateOptions): Promise<AggregateResult>;
|
|
289
289
|
|
|
290
|
+
type RevenueRollupDimension = 'vertical' | 'contractType' | 'contractCategory' | 'company' | 'month' | 'billingItemKind' | 'contract' | 'lineOfBusiness' | 'resource' | 'billingCode';
|
|
291
|
+
/** The closed opts bag. Exactly one scope key is required. */
|
|
292
|
+
interface RevenueRollupOptions {
|
|
293
|
+
companyIDs?: number[];
|
|
294
|
+
/** `companies.ownerResourceID`, resolved to company ids (one projected query) before the walk. */
|
|
295
|
+
ownerResourceID?: number;
|
|
296
|
+
contractIDs?: number[];
|
|
297
|
+
tenantWide?: true;
|
|
298
|
+
/** 'YYYY-MM-DD', inclusive. */
|
|
299
|
+
dateFrom: string;
|
|
300
|
+
/** 'YYYY-MM-DD', inclusive; window ≤ 36 months. */
|
|
301
|
+
dateTo: string;
|
|
302
|
+
/** Ids or labels; default = the live labels that START with 'Recurring' or 'Fixed' (case-insensitive). */
|
|
303
|
+
contractTypes?: Array<number | string>;
|
|
304
|
+
contractCategories?: Array<number | string>;
|
|
305
|
+
/** Default ['vertical', 'contractType']. */
|
|
306
|
+
groupBy?: RevenueRollupDimension[];
|
|
307
|
+
/** Rows kept (default 100, cap 100); the tail folds into `rowsTruncated`. */
|
|
308
|
+
top?: number;
|
|
309
|
+
/** Vendor-call budget (default 90, or 150 with includeNonChargeable; cap 200). */
|
|
310
|
+
maxVendorCalls?: number;
|
|
311
|
+
/** Add per-row non-chargeable work (contract-covered and non-billable: value + hours), never added to revenue. Default false. */
|
|
312
|
+
includeNonChargeable?: boolean;
|
|
313
|
+
}
|
|
314
|
+
/** A dimension value: picklist text in `label`, vendor entity text (untrusted) in `name` (and, for lineOfBusiness, `division`). */
|
|
315
|
+
interface RevenueRollupKey {
|
|
316
|
+
id: number | string | null;
|
|
317
|
+
label?: string;
|
|
318
|
+
name?: string;
|
|
319
|
+
division?: string;
|
|
320
|
+
}
|
|
321
|
+
interface RevenueRollupAmount {
|
|
322
|
+
amount: number;
|
|
323
|
+
lines: number;
|
|
324
|
+
}
|
|
325
|
+
/** Non-chargeable work: Σ internalCurrencyExtendedPrice (`value`), Σ quantity on labour lines (`hours`), line count. */
|
|
326
|
+
interface RevenueRollupNonChargeableAmount {
|
|
327
|
+
value: number;
|
|
328
|
+
hours: number;
|
|
329
|
+
lines: number;
|
|
330
|
+
}
|
|
331
|
+
interface RevenueRollupNonChargeable {
|
|
332
|
+
contractCovered: RevenueRollupNonChargeableAmount;
|
|
333
|
+
nonBillable: RevenueRollupNonChargeableAmount;
|
|
334
|
+
}
|
|
335
|
+
interface RevenueRollupRow {
|
|
336
|
+
keys: Partial<Record<RevenueRollupDimension, RevenueRollupKey>>;
|
|
337
|
+
revenue: number;
|
|
338
|
+
credits: RevenueRollupAmount;
|
|
339
|
+
includedValue: number;
|
|
340
|
+
contracts: number;
|
|
341
|
+
items: number;
|
|
342
|
+
/** Only with includeNonChargeable; never part of `revenue`. */
|
|
343
|
+
nonChargeable?: RevenueRollupNonChargeable;
|
|
344
|
+
}
|
|
345
|
+
interface RevenueRollupResult {
|
|
346
|
+
window: {
|
|
347
|
+
dateFrom: string;
|
|
348
|
+
dateTo: string;
|
|
349
|
+
basis: 'invoiceDate';
|
|
350
|
+
};
|
|
351
|
+
scope: {
|
|
352
|
+
kind: 'companyIDs' | 'ownerResourceID' | 'contractIDs' | 'tenantWide';
|
|
353
|
+
ownerResourceID?: number;
|
|
354
|
+
ids?: number[];
|
|
355
|
+
};
|
|
356
|
+
groupBy: RevenueRollupDimension[];
|
|
357
|
+
top: number;
|
|
358
|
+
rows: RevenueRollupRow[];
|
|
359
|
+
rowsTruncated?: {
|
|
360
|
+
rows: number;
|
|
361
|
+
revenue: number;
|
|
362
|
+
};
|
|
363
|
+
totals: {
|
|
364
|
+
revenue: number;
|
|
365
|
+
credits: number;
|
|
366
|
+
includedValue: number;
|
|
367
|
+
contracts: number;
|
|
368
|
+
items: number;
|
|
369
|
+
nonChargeable?: RevenueRollupNonChargeable;
|
|
370
|
+
};
|
|
371
|
+
coverage: {
|
|
372
|
+
/** Logical vendor requests through the budget wrapper; transport retries (429 / 5xx, up to maxRetries each) are not counted. */
|
|
373
|
+
vendorCalls: number;
|
|
374
|
+
budget: number;
|
|
375
|
+
estimate: number;
|
|
376
|
+
/** vendorCalls as a share of the 10,000/h tenant limit (a floor: transport retries are not counted). */
|
|
377
|
+
tenantHourlyShare: string;
|
|
378
|
+
contractTypeMap: Record<string, string>;
|
|
379
|
+
contractCategoryMap?: Record<string, string>;
|
|
380
|
+
reconciliation: {
|
|
381
|
+
headerTotal: number;
|
|
382
|
+
lineTotal: number;
|
|
383
|
+
delta: number;
|
|
384
|
+
invoicesChecked: number;
|
|
385
|
+
invoicesMismatched: number;
|
|
386
|
+
};
|
|
387
|
+
/** Informational overlay, NOT an excluded bucket: zero-total invoices in scope and their lines (those lines are still folded into rows / the buckets). */
|
|
388
|
+
zeroTotalInvoices: {
|
|
389
|
+
count: number;
|
|
390
|
+
} & RevenueRollupAmount;
|
|
391
|
+
excluded: {
|
|
392
|
+
/** Header figures of the window's voided invoices in scope (company scopes: header companyID in scope). Absent for a contractIDs scope: an invoice header cannot be attributed to a contract. */
|
|
393
|
+
voidedInvoices?: {
|
|
394
|
+
count: number;
|
|
395
|
+
headerAmount: number;
|
|
396
|
+
};
|
|
397
|
+
uncontracted: RevenueRollupAmount;
|
|
398
|
+
otherContractTypes: Record<string, RevenueRollupAmount>;
|
|
399
|
+
otherContractCategories: Record<string, RevenueRollupAmount>;
|
|
400
|
+
unresolvedContracts: RevenueRollupAmount;
|
|
401
|
+
unresolvedCompanies: RevenueRollupAmount;
|
|
402
|
+
/** Only when lineOfBusiness is grouped: a line association (or its level1/level2) the id-in fetch did not return. */
|
|
403
|
+
unresolvedAssociations?: RevenueRollupAmount;
|
|
404
|
+
/** Only when resource is grouped: a labour line's time entry (or its resource) the id-in fetch did not return. */
|
|
405
|
+
unresolvedTimeEntries?: RevenueRollupAmount;
|
|
406
|
+
/** Only when billingCode is grouped: a line billing code the id-in fetch did not return. */
|
|
407
|
+
unresolvedBillingCodes?: RevenueRollupAmount;
|
|
408
|
+
/** Only with includeNonChargeable: invoiced and uninvoiced non-chargeable lines whose row could not be resolved (a contract, company or join miss; amount = Σ value). */
|
|
409
|
+
unresolvedNonChargeable?: RevenueRollupAmount;
|
|
410
|
+
};
|
|
411
|
+
/** Only when lineOfBusiness is grouped: in-scope lines with no LOB pointer (also their own "no LOB assigned" row). */
|
|
412
|
+
lineOfBusiness?: {
|
|
413
|
+
noPointer: RevenueRollupAmount;
|
|
414
|
+
note: string;
|
|
415
|
+
};
|
|
416
|
+
blindSurfaces: string[];
|
|
417
|
+
notes: string[];
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* `operations.revenueRollup` — see the module header.
|
|
422
|
+
*
|
|
423
|
+
* ```ts
|
|
424
|
+
* import { revenueRollup } from 'node-autotask/operations';
|
|
425
|
+
* const r = await revenueRollup(client, { tenantWide: true, dateFrom: '2025-07-01', dateTo: '2026-06-30' });
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
428
|
+
declare function revenueRollup(client: AutotaskClient, opts: RevenueRollupOptions): Promise<RevenueRollupResult>;
|
|
429
|
+
|
|
290
430
|
/** The pinned per-call item cap (total items per call, mixed resources — the issue's "500 ids" budget; over → CONFIG_ERROR pre-request, zero wire). */
|
|
291
431
|
declare const FETCH_BY_IDS_MAX_ITEMS = 500;
|
|
292
432
|
/** The pinned `id in` chunk size (250/chunk — the chunk query is a single page: 250 is well under the 500 vendor page max). */
|
|
@@ -696,7 +836,7 @@ interface FieldCatalogRow {
|
|
|
696
836
|
resource: string;
|
|
697
837
|
/** The vendor entity name (the path segment; plan-derived). */
|
|
698
838
|
apiEntity: string;
|
|
699
|
-
/**
|
|
839
|
+
/** The plan resource's `udfCapable` flag, read from the registry record (`CapabilityRecord.udfCapable`, issue #254): true for the resources whose records carry `userDefinedFields`. Every vendor entity has a `getUdfInfo` catalog endpoint, so the `udf` include works on any row; that endpoint's presence does not make a resource UDF-capable. */
|
|
700
840
|
udfCapable: boolean;
|
|
701
841
|
/** The filter mechanism for a UDF name — present exactly when `udfCapable`: a filter on a UDF name is accepted only with the vendor's `udf: true` marker (a plain filter is refused), so the row states the marker rather than leaving a consumer to read the UDF rows' `isQueryable` (issue #219 N7). */
|
|
702
842
|
udfFilter?: 'udf-marker';
|
|
@@ -759,7 +899,7 @@ interface FieldCatalogResult {
|
|
|
759
899
|
resources: number;
|
|
760
900
|
/** The plan's `getFieldInfo`-bearing resource count (the field-capable set). */
|
|
761
901
|
fieldCapableResources: number;
|
|
762
|
-
/** The plan's `
|
|
902
|
+
/** The plan's `udfCapable` resource count (issue #254: the resources whose records carry `userDefinedFields` — not the wider set with a `getUdfInfo` catalog endpoint). */
|
|
763
903
|
udfCapableResources: number;
|
|
764
904
|
/** The rows served fully from the cache. */
|
|
765
905
|
cached: number;
|
|
@@ -1081,4 +1221,4 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
|
|
|
1081
1221
|
*/
|
|
1082
1222
|
declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[] | Record<string, unknown>, opts?: InvokeOptions): Promise<unknown>;
|
|
1083
1223
|
|
|
1084
|
-
export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, ENTITY_TYPE_TO_RESOURCE, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, isEnumerableResource, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resourceForEntityType, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
1224
|
+
export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, ENTITY_TYPE_TO_RESOURCE, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type RevenueRollupAmount, type RevenueRollupDimension, type RevenueRollupKey, type RevenueRollupNonChargeable, type RevenueRollupNonChargeableAmount, type RevenueRollupOptions, type RevenueRollupResult, type RevenueRollupRow, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, isEnumerableResource, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resourceForEntityType, revenueRollup, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as AutotaskClient,
|
|
2
|
-
export {
|
|
1
|
+
import { a as AutotaskClient, eF as BlindSurfaceInfo, eG as RelationshipResource, eH as BlindSurfaceInventory, eI as BlindSurfaceRow, eJ as CreateGuidanceValueRequirement, eK as CreateGuidanceRow, eL as CreateBlockerKind, eM as CreateGuidanceReport, Z as ZoneName, eN as FieldCacheKind, k as AutotaskConfigError } from '../index-BDqw377y.js';
|
|
2
|
+
export { eO as FIELD_CACHE_KINDS } from '../index-BDqw377y.js';
|
|
3
3
|
import { I as Identifier, cX as EmptyReasonInfo, e9 as PickListValue, a as FilterCondition } from '../index-m-7fOwFl.js';
|
|
4
4
|
export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-m-7fOwFl.js';
|
|
5
5
|
import { CapabilityRecord } from '../capabilities.js';
|
|
@@ -287,6 +287,146 @@ interface AggregateResult {
|
|
|
287
287
|
*/
|
|
288
288
|
declare function aggregate(client: AutotaskClient, operation: string, filter: unknown, opts?: AggregateOptions): Promise<AggregateResult>;
|
|
289
289
|
|
|
290
|
+
type RevenueRollupDimension = 'vertical' | 'contractType' | 'contractCategory' | 'company' | 'month' | 'billingItemKind' | 'contract' | 'lineOfBusiness' | 'resource' | 'billingCode';
|
|
291
|
+
/** The closed opts bag. Exactly one scope key is required. */
|
|
292
|
+
interface RevenueRollupOptions {
|
|
293
|
+
companyIDs?: number[];
|
|
294
|
+
/** `companies.ownerResourceID`, resolved to company ids (one projected query) before the walk. */
|
|
295
|
+
ownerResourceID?: number;
|
|
296
|
+
contractIDs?: number[];
|
|
297
|
+
tenantWide?: true;
|
|
298
|
+
/** 'YYYY-MM-DD', inclusive. */
|
|
299
|
+
dateFrom: string;
|
|
300
|
+
/** 'YYYY-MM-DD', inclusive; window ≤ 36 months. */
|
|
301
|
+
dateTo: string;
|
|
302
|
+
/** Ids or labels; default = the live labels that START with 'Recurring' or 'Fixed' (case-insensitive). */
|
|
303
|
+
contractTypes?: Array<number | string>;
|
|
304
|
+
contractCategories?: Array<number | string>;
|
|
305
|
+
/** Default ['vertical', 'contractType']. */
|
|
306
|
+
groupBy?: RevenueRollupDimension[];
|
|
307
|
+
/** Rows kept (default 100, cap 100); the tail folds into `rowsTruncated`. */
|
|
308
|
+
top?: number;
|
|
309
|
+
/** Vendor-call budget (default 90, or 150 with includeNonChargeable; cap 200). */
|
|
310
|
+
maxVendorCalls?: number;
|
|
311
|
+
/** Add per-row non-chargeable work (contract-covered and non-billable: value + hours), never added to revenue. Default false. */
|
|
312
|
+
includeNonChargeable?: boolean;
|
|
313
|
+
}
|
|
314
|
+
/** A dimension value: picklist text in `label`, vendor entity text (untrusted) in `name` (and, for lineOfBusiness, `division`). */
|
|
315
|
+
interface RevenueRollupKey {
|
|
316
|
+
id: number | string | null;
|
|
317
|
+
label?: string;
|
|
318
|
+
name?: string;
|
|
319
|
+
division?: string;
|
|
320
|
+
}
|
|
321
|
+
interface RevenueRollupAmount {
|
|
322
|
+
amount: number;
|
|
323
|
+
lines: number;
|
|
324
|
+
}
|
|
325
|
+
/** Non-chargeable work: Σ internalCurrencyExtendedPrice (`value`), Σ quantity on labour lines (`hours`), line count. */
|
|
326
|
+
interface RevenueRollupNonChargeableAmount {
|
|
327
|
+
value: number;
|
|
328
|
+
hours: number;
|
|
329
|
+
lines: number;
|
|
330
|
+
}
|
|
331
|
+
interface RevenueRollupNonChargeable {
|
|
332
|
+
contractCovered: RevenueRollupNonChargeableAmount;
|
|
333
|
+
nonBillable: RevenueRollupNonChargeableAmount;
|
|
334
|
+
}
|
|
335
|
+
interface RevenueRollupRow {
|
|
336
|
+
keys: Partial<Record<RevenueRollupDimension, RevenueRollupKey>>;
|
|
337
|
+
revenue: number;
|
|
338
|
+
credits: RevenueRollupAmount;
|
|
339
|
+
includedValue: number;
|
|
340
|
+
contracts: number;
|
|
341
|
+
items: number;
|
|
342
|
+
/** Only with includeNonChargeable; never part of `revenue`. */
|
|
343
|
+
nonChargeable?: RevenueRollupNonChargeable;
|
|
344
|
+
}
|
|
345
|
+
interface RevenueRollupResult {
|
|
346
|
+
window: {
|
|
347
|
+
dateFrom: string;
|
|
348
|
+
dateTo: string;
|
|
349
|
+
basis: 'invoiceDate';
|
|
350
|
+
};
|
|
351
|
+
scope: {
|
|
352
|
+
kind: 'companyIDs' | 'ownerResourceID' | 'contractIDs' | 'tenantWide';
|
|
353
|
+
ownerResourceID?: number;
|
|
354
|
+
ids?: number[];
|
|
355
|
+
};
|
|
356
|
+
groupBy: RevenueRollupDimension[];
|
|
357
|
+
top: number;
|
|
358
|
+
rows: RevenueRollupRow[];
|
|
359
|
+
rowsTruncated?: {
|
|
360
|
+
rows: number;
|
|
361
|
+
revenue: number;
|
|
362
|
+
};
|
|
363
|
+
totals: {
|
|
364
|
+
revenue: number;
|
|
365
|
+
credits: number;
|
|
366
|
+
includedValue: number;
|
|
367
|
+
contracts: number;
|
|
368
|
+
items: number;
|
|
369
|
+
nonChargeable?: RevenueRollupNonChargeable;
|
|
370
|
+
};
|
|
371
|
+
coverage: {
|
|
372
|
+
/** Logical vendor requests through the budget wrapper; transport retries (429 / 5xx, up to maxRetries each) are not counted. */
|
|
373
|
+
vendorCalls: number;
|
|
374
|
+
budget: number;
|
|
375
|
+
estimate: number;
|
|
376
|
+
/** vendorCalls as a share of the 10,000/h tenant limit (a floor: transport retries are not counted). */
|
|
377
|
+
tenantHourlyShare: string;
|
|
378
|
+
contractTypeMap: Record<string, string>;
|
|
379
|
+
contractCategoryMap?: Record<string, string>;
|
|
380
|
+
reconciliation: {
|
|
381
|
+
headerTotal: number;
|
|
382
|
+
lineTotal: number;
|
|
383
|
+
delta: number;
|
|
384
|
+
invoicesChecked: number;
|
|
385
|
+
invoicesMismatched: number;
|
|
386
|
+
};
|
|
387
|
+
/** Informational overlay, NOT an excluded bucket: zero-total invoices in scope and their lines (those lines are still folded into rows / the buckets). */
|
|
388
|
+
zeroTotalInvoices: {
|
|
389
|
+
count: number;
|
|
390
|
+
} & RevenueRollupAmount;
|
|
391
|
+
excluded: {
|
|
392
|
+
/** Header figures of the window's voided invoices in scope (company scopes: header companyID in scope). Absent for a contractIDs scope: an invoice header cannot be attributed to a contract. */
|
|
393
|
+
voidedInvoices?: {
|
|
394
|
+
count: number;
|
|
395
|
+
headerAmount: number;
|
|
396
|
+
};
|
|
397
|
+
uncontracted: RevenueRollupAmount;
|
|
398
|
+
otherContractTypes: Record<string, RevenueRollupAmount>;
|
|
399
|
+
otherContractCategories: Record<string, RevenueRollupAmount>;
|
|
400
|
+
unresolvedContracts: RevenueRollupAmount;
|
|
401
|
+
unresolvedCompanies: RevenueRollupAmount;
|
|
402
|
+
/** Only when lineOfBusiness is grouped: a line association (or its level1/level2) the id-in fetch did not return. */
|
|
403
|
+
unresolvedAssociations?: RevenueRollupAmount;
|
|
404
|
+
/** Only when resource is grouped: a labour line's time entry (or its resource) the id-in fetch did not return. */
|
|
405
|
+
unresolvedTimeEntries?: RevenueRollupAmount;
|
|
406
|
+
/** Only when billingCode is grouped: a line billing code the id-in fetch did not return. */
|
|
407
|
+
unresolvedBillingCodes?: RevenueRollupAmount;
|
|
408
|
+
/** Only with includeNonChargeable: invoiced and uninvoiced non-chargeable lines whose row could not be resolved (a contract, company or join miss; amount = Σ value). */
|
|
409
|
+
unresolvedNonChargeable?: RevenueRollupAmount;
|
|
410
|
+
};
|
|
411
|
+
/** Only when lineOfBusiness is grouped: in-scope lines with no LOB pointer (also their own "no LOB assigned" row). */
|
|
412
|
+
lineOfBusiness?: {
|
|
413
|
+
noPointer: RevenueRollupAmount;
|
|
414
|
+
note: string;
|
|
415
|
+
};
|
|
416
|
+
blindSurfaces: string[];
|
|
417
|
+
notes: string[];
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* `operations.revenueRollup` — see the module header.
|
|
422
|
+
*
|
|
423
|
+
* ```ts
|
|
424
|
+
* import { revenueRollup } from 'node-autotask/operations';
|
|
425
|
+
* const r = await revenueRollup(client, { tenantWide: true, dateFrom: '2025-07-01', dateTo: '2026-06-30' });
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
428
|
+
declare function revenueRollup(client: AutotaskClient, opts: RevenueRollupOptions): Promise<RevenueRollupResult>;
|
|
429
|
+
|
|
290
430
|
/** The pinned per-call item cap (total items per call, mixed resources — the issue's "500 ids" budget; over → CONFIG_ERROR pre-request, zero wire). */
|
|
291
431
|
declare const FETCH_BY_IDS_MAX_ITEMS = 500;
|
|
292
432
|
/** The pinned `id in` chunk size (250/chunk — the chunk query is a single page: 250 is well under the 500 vendor page max). */
|
|
@@ -696,7 +836,7 @@ interface FieldCatalogRow {
|
|
|
696
836
|
resource: string;
|
|
697
837
|
/** The vendor entity name (the path segment; plan-derived). */
|
|
698
838
|
apiEntity: string;
|
|
699
|
-
/**
|
|
839
|
+
/** The plan resource's `udfCapable` flag, read from the registry record (`CapabilityRecord.udfCapable`, issue #254): true for the resources whose records carry `userDefinedFields`. Every vendor entity has a `getUdfInfo` catalog endpoint, so the `udf` include works on any row; that endpoint's presence does not make a resource UDF-capable. */
|
|
700
840
|
udfCapable: boolean;
|
|
701
841
|
/** The filter mechanism for a UDF name — present exactly when `udfCapable`: a filter on a UDF name is accepted only with the vendor's `udf: true` marker (a plain filter is refused), so the row states the marker rather than leaving a consumer to read the UDF rows' `isQueryable` (issue #219 N7). */
|
|
702
842
|
udfFilter?: 'udf-marker';
|
|
@@ -759,7 +899,7 @@ interface FieldCatalogResult {
|
|
|
759
899
|
resources: number;
|
|
760
900
|
/** The plan's `getFieldInfo`-bearing resource count (the field-capable set). */
|
|
761
901
|
fieldCapableResources: number;
|
|
762
|
-
/** The plan's `
|
|
902
|
+
/** The plan's `udfCapable` resource count (issue #254: the resources whose records carry `userDefinedFields` — not the wider set with a `getUdfInfo` catalog endpoint). */
|
|
763
903
|
udfCapableResources: number;
|
|
764
904
|
/** The rows served fully from the cache. */
|
|
765
905
|
cached: number;
|
|
@@ -1081,4 +1221,4 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
|
|
|
1081
1221
|
*/
|
|
1082
1222
|
declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[] | Record<string, unknown>, opts?: InvokeOptions): Promise<unknown>;
|
|
1083
1223
|
|
|
1084
|
-
export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, ENTITY_TYPE_TO_RESOURCE, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, isEnumerableResource, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resourceForEntityType, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
1224
|
+
export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, ENTITY_TYPE_TO_RESOURCE, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type RevenueRollupAmount, type RevenueRollupDimension, type RevenueRollupKey, type RevenueRollupNonChargeable, type RevenueRollupNonChargeableAmount, type RevenueRollupOptions, type RevenueRollupResult, type RevenueRollupRow, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, isEnumerableResource, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resourceForEntityType, revenueRollup, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|