@campfire-interactive/master-data-client 5.8.0 → 5.10.2
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/aiConfig.d.ts +35 -0
- package/dist/aiConfig.d.ts.map +1 -0
- package/dist/aiConfig.js +63 -0
- package/dist/aiConfig.js.map +1 -0
- package/dist/attributeOptions.d.ts +8 -1
- package/dist/attributeOptions.d.ts.map +1 -1
- package/dist/attributeOptions.js +19 -0
- package/dist/attributeOptions.js.map +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -0
- package/dist/client.js.map +1 -1
- package/dist/currencies.d.ts +52 -0
- package/dist/currencies.d.ts.map +1 -0
- package/dist/currencies.js +86 -0
- package/dist/currencies.js.map +1 -0
- package/dist/exchangeRates.d.ts +17 -1
- package/dist/exchangeRates.d.ts.map +1 -1
- package/dist/exchangeRates.js +28 -0
- package/dist/exchangeRates.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/quoteStatus.d.ts +36 -0
- package/dist/quoteStatus.d.ts.map +1 -0
- package/dist/quoteStatus.js +54 -0
- package/dist/quoteStatus.js.map +1 -0
- package/dist/types.d.ts +184 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.ForbiddenError = exports.UnauthorizedError = exports.ConflictError = exports.ValidationError = exports.NotFoundError = exports.MasterDataError = exports.schedulePeriodGranularity = exports.formatSchedulePeriod = exports.OwnershipResource = exports.PartResource = exports.attributeFilterMatch = exports.toClientAttributeDefinition = exports.missingRequiredAttributes = exports.formatAttributeValue = void 0;
|
|
3
|
+
exports.sanitizeAttributeBag = exports.relabelAttributeErrors = exports.stripEmptyAttributeValues = exports.applyAttributePatch = exports.normalizeAttributeBag = exports.isUnansweredAttributeValue = exports.isEmptyAttributeValue = exports.assertValidAttributeBag = exports.validateAttributeBag = exports.AttributeOptionResource = exports.AttributeGroupResource = exports.AttributeDefinitionResource = exports.PartAttributeResource = exports.QuoteDocumentRequirementResource = exports.PartTypeResource = exports.PartTypeDefaultResource = exports.ScopeDimensionSettingResource = exports.ScopeResource = exports.ScopeDefaultResource = exports.PartCategoryResource = exports.StandardAttributeResource = exports.PartCategoryDefaultResource = exports.OemFormTemplateResource = exports.ExternalReferenceResource = exports.RegionResource = exports.CurrencyResource = exports.ExchangeRateResource = exports.AiConfigResource = exports.RatesResource = exports.RateCatalogResource = exports.RateTableResource = exports.RateElementResource = exports.RateBookResource = exports.ProcessFamilyCategoryResource = exports.ProcessFamilyResource = exports.EquipmentResource = exports.PlantResource = exports.MaterialResource = exports.EngineeringChangeResource = exports.QuoteAskResource = exports.QuoteLineResource = exports.QuoteResource = exports.ProgramResource = exports.ImportTemplateResource = exports.ImportResource = exports.LocationResource = exports.ContactResource = exports.CompanyResource = exports.MockMasterDataClient = exports.MasterDataClient = void 0;
|
|
4
|
+
exports.ForbiddenError = exports.UnauthorizedError = exports.ConflictError = exports.ValidationError = exports.NotFoundError = exports.MasterDataError = exports.quoteStatusBucket = exports.isOpenQuoteStatus = exports.CLOSED_QUOTE_STATUSES = exports.OPEN_QUOTE_STATUSES = exports.schedulePeriodGranularity = exports.formatSchedulePeriod = exports.OwnershipResource = exports.PartResource = exports.attributeFilterMatch = exports.toClientAttributeDefinition = exports.missingRequiredAttributes = exports.formatAttributeValue = exports.attributeOptionsFor = exports.createAttributeDefinitionsCache = void 0;
|
|
5
5
|
// Client
|
|
6
6
|
var client_1 = require("./client");
|
|
7
7
|
Object.defineProperty(exports, "MasterDataClient", { enumerable: true, get: function () { return client_1.MasterDataClient; } });
|
|
@@ -48,8 +48,12 @@ var rateCatalog_1 = require("./rateCatalog");
|
|
|
48
48
|
Object.defineProperty(exports, "RateCatalogResource", { enumerable: true, get: function () { return rateCatalog_1.RateCatalogResource; } });
|
|
49
49
|
var rates_1 = require("./rates");
|
|
50
50
|
Object.defineProperty(exports, "RatesResource", { enumerable: true, get: function () { return rates_1.RatesResource; } });
|
|
51
|
+
var aiConfig_1 = require("./aiConfig");
|
|
52
|
+
Object.defineProperty(exports, "AiConfigResource", { enumerable: true, get: function () { return aiConfig_1.AiConfigResource; } });
|
|
51
53
|
var exchangeRates_1 = require("./exchangeRates");
|
|
52
54
|
Object.defineProperty(exports, "ExchangeRateResource", { enumerable: true, get: function () { return exchangeRates_1.ExchangeRateResource; } });
|
|
55
|
+
var currencies_1 = require("./currencies");
|
|
56
|
+
Object.defineProperty(exports, "CurrencyResource", { enumerable: true, get: function () { return currencies_1.CurrencyResource; } });
|
|
53
57
|
var regions_1 = require("./regions");
|
|
54
58
|
Object.defineProperty(exports, "RegionResource", { enumerable: true, get: function () { return regions_1.RegionResource; } });
|
|
55
59
|
var externalReferences_1 = require("./externalReferences");
|
|
@@ -109,6 +113,13 @@ Object.defineProperty(exports, "OwnershipResource", { enumerable: true, get: fun
|
|
|
109
113
|
var schedulePeriods_1 = require("./schedulePeriods");
|
|
110
114
|
Object.defineProperty(exports, "formatSchedulePeriod", { enumerable: true, get: function () { return schedulePeriods_1.formatSchedulePeriod; } });
|
|
111
115
|
Object.defineProperty(exports, "schedulePeriodGranularity", { enumerable: true, get: function () { return schedulePeriods_1.schedulePeriodGranularity; } });
|
|
116
|
+
// Quote lifecycle buckets — the shared "is this quote still work?" split, so
|
|
117
|
+
// consumers stop writing their own `status === 'awarded'` checks.
|
|
118
|
+
var quoteStatus_1 = require("./quoteStatus");
|
|
119
|
+
Object.defineProperty(exports, "OPEN_QUOTE_STATUSES", { enumerable: true, get: function () { return quoteStatus_1.OPEN_QUOTE_STATUSES; } });
|
|
120
|
+
Object.defineProperty(exports, "CLOSED_QUOTE_STATUSES", { enumerable: true, get: function () { return quoteStatus_1.CLOSED_QUOTE_STATUSES; } });
|
|
121
|
+
Object.defineProperty(exports, "isOpenQuoteStatus", { enumerable: true, get: function () { return quoteStatus_1.isOpenQuoteStatus; } });
|
|
122
|
+
Object.defineProperty(exports, "quoteStatusBucket", { enumerable: true, get: function () { return quoteStatus_1.quoteStatusBucket; } });
|
|
112
123
|
// Errors
|
|
113
124
|
var errors_1 = require("./errors");
|
|
114
125
|
Object.defineProperty(exports, "MasterDataError", { enumerable: true, get: function () { return errors_1.MasterDataError; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,SAAS;AACT,mCAA4C;AAAnC,0GAAA,gBAAgB,OAAA;AACzB,+BAA8C;AAArC,4GAAA,oBAAoB,OAAA;AAE7B,yCAAyC;AACzC,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AACxB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAEvB,yCAAqD;AAA5C,mHAAA,sBAAsB,OAAA;AAC/B,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AACxB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA;AAC1B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,2DAAiE;AAAxD,+HAAA,yBAAyB,OAAA;AAClC,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,yCAAgD;AAAvC,8GAAA,iBAAiB,OAAA;AAC1B,qDAA0D;AAAjD,wHAAA,qBAAqB,OAAA;AAC9B,qEAA0E;AAAjE,wIAAA,6BAA6B,OAAA;AACtC,yCAA+C;AAAtC,6GAAA,gBAAgB,O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BAAsB,OAAA;AACtB,oHAAA,oBAAoB,OAAA;AACpB,+HAAA,+BAA+B,OAAA;AAC/B,mHAAA,mBAAmB,OAAA;AACnB,oHAAA,oBAAoB,OAAA;AACpB,yHAAA,yBAAyB,OAAA;AACzB,2HAAA,2BAA2B,OAAA;AAC3B,oHAAA,oBAAoB,OAAA;AAStB,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,yCAAgD;AAAvC,8GAAA,iBAAiB,OAAA;AAE1B,8EAA8E;AAC9E,qDAI2B;AAHzB,uHAAA,oBAAoB,OAAA;AACpB,4HAAA,yBAAyB,OAAA;AAI3B,6EAA6E;AAC7E,kEAAkE;AAClE,6CAMuB;AALrB,kHAAA,mBAAmB,OAAA;AACnB,oHAAA,qBAAqB,OAAA;AACrB,gHAAA,iBAAiB,OAAA;AACjB,gHAAA,iBAAiB,OAAA;AA0VnB,SAAS;AACT,mCAOkB;AANhB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AACjB,wGAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { QuoteStatus } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Lifecycle buckets over {@link QuoteStatus} — the shared answer to "is this
|
|
4
|
+
* quote still work?".
|
|
5
|
+
*
|
|
6
|
+
* The server has had this split since the state machine was written
|
|
7
|
+
* (`TERMINAL_STATUSES`), but it was never published, so a consumer wanting
|
|
8
|
+
* "the quotes still in play" wrote its own `status === 'awarded'` check
|
|
9
|
+
* against its own idea of the list. OMSF and CPQ both list the same federated
|
|
10
|
+
* quotes on their own quote pages; they must not disagree about which rows are
|
|
11
|
+
* live.
|
|
12
|
+
*
|
|
13
|
+
* Shipped as a pure helper (like `schedulePeriods`) rather than as a server
|
|
14
|
+
* call: both quote pages already hold the full set client-side, and the
|
|
15
|
+
* question is about a value they already have. `GET /v1/quotes?status=open`
|
|
16
|
+
* answers the same question for callers that page server-side.
|
|
17
|
+
*/
|
|
18
|
+
/** `open` (still work) | `awarded` (won) | `closed` (lost or not taken). */
|
|
19
|
+
export type QuoteStatusBucket = 'open' | 'awarded' | 'closed';
|
|
20
|
+
/**
|
|
21
|
+
* Still work: draft through negotiating. Mirrors the server's `OPEN_STATUSES`
|
|
22
|
+
* and is the set behind `GET /v1/quotes?status=open`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const OPEN_QUOTE_STATUSES: readonly QuoteStatus[];
|
|
25
|
+
/** Closed and not won: `lost`, `not_taken`. */
|
|
26
|
+
export declare const CLOSED_QUOTE_STATUSES: readonly QuoteStatus[];
|
|
27
|
+
/**
|
|
28
|
+
* Which bucket a status falls in. An unrecognized value is reported as `open`:
|
|
29
|
+
* a status this build hasn't heard of is far likelier to be a newly added
|
|
30
|
+
* working state than a new terminal one, and the failure that matters is
|
|
31
|
+
* hiding live work, not listing one row too many.
|
|
32
|
+
*/
|
|
33
|
+
export declare function quoteStatusBucket(status: QuoteStatus | string | null | undefined): QuoteStatusBucket;
|
|
34
|
+
/** True for every status in {@link OPEN_QUOTE_STATUSES}. */
|
|
35
|
+
export declare function isOpenQuoteStatus(status: QuoteStatus | string | null | undefined): boolean;
|
|
36
|
+
//# sourceMappingURL=quoteStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quoteStatus.d.ts","sourceRoot":"","sources":["../src/quoteStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAiC9D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,WAAW,EAAuB,CAAC;AAE9E,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,EAAE,SAAS,WAAW,EAAyB,CAAC;AAElF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9C,iBAAiB,CAGnB;AAED,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE1F"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLOSED_QUOTE_STATUSES = exports.OPEN_QUOTE_STATUSES = void 0;
|
|
4
|
+
exports.quoteStatusBucket = quoteStatusBucket;
|
|
5
|
+
exports.isOpenQuoteStatus = isOpenQuoteStatus;
|
|
6
|
+
/**
|
|
7
|
+
* The one table. `Record<QuoteStatus, …>` is what makes it exhaustive: adding
|
|
8
|
+
* a status to {@link QuoteStatus} without bucketing it here fails to compile,
|
|
9
|
+
* which is the only way to keep this from drifting behind the state machine.
|
|
10
|
+
*
|
|
11
|
+
* `lost` and `not_taken` share a bucket here and stay distinct everywhere else
|
|
12
|
+
* — see {@link QuoteStatus} on why collapsing them miscounts a won deal as a
|
|
13
|
+
* defeat. This bucket answers only "should the row be in the working list?",
|
|
14
|
+
* and that answer is the same for both.
|
|
15
|
+
*/
|
|
16
|
+
const BUCKET_BY_STATUS = {
|
|
17
|
+
draft: 'open',
|
|
18
|
+
costing_requested: 'open',
|
|
19
|
+
costing_in_progress: 'open',
|
|
20
|
+
costing_complete: 'open',
|
|
21
|
+
pricing: 'open',
|
|
22
|
+
routed_for_approval: 'open',
|
|
23
|
+
in_review: 'open',
|
|
24
|
+
approved: 'open',
|
|
25
|
+
submitted: 'open',
|
|
26
|
+
negotiating: 'open',
|
|
27
|
+
awarded: 'awarded',
|
|
28
|
+
lost: 'closed',
|
|
29
|
+
not_taken: 'closed',
|
|
30
|
+
};
|
|
31
|
+
const statusesIn = (bucket) => Object.keys(BUCKET_BY_STATUS).filter((s) => BUCKET_BY_STATUS[s] === bucket);
|
|
32
|
+
/**
|
|
33
|
+
* Still work: draft through negotiating. Mirrors the server's `OPEN_STATUSES`
|
|
34
|
+
* and is the set behind `GET /v1/quotes?status=open`.
|
|
35
|
+
*/
|
|
36
|
+
exports.OPEN_QUOTE_STATUSES = statusesIn('open');
|
|
37
|
+
/** Closed and not won: `lost`, `not_taken`. */
|
|
38
|
+
exports.CLOSED_QUOTE_STATUSES = statusesIn('closed');
|
|
39
|
+
/**
|
|
40
|
+
* Which bucket a status falls in. An unrecognized value is reported as `open`:
|
|
41
|
+
* a status this build hasn't heard of is far likelier to be a newly added
|
|
42
|
+
* working state than a new terminal one, and the failure that matters is
|
|
43
|
+
* hiding live work, not listing one row too many.
|
|
44
|
+
*/
|
|
45
|
+
function quoteStatusBucket(status) {
|
|
46
|
+
if (status == null)
|
|
47
|
+
return 'open';
|
|
48
|
+
return BUCKET_BY_STATUS[status] ?? 'open';
|
|
49
|
+
}
|
|
50
|
+
/** True for every status in {@link OPEN_QUOTE_STATUSES}. */
|
|
51
|
+
function isOpenQuoteStatus(status) {
|
|
52
|
+
return quoteStatusBucket(status) === 'open';
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=quoteStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quoteStatus.js","sourceRoot":"","sources":["../src/quoteStatus.ts"],"names":[],"mappings":";;;AAoEA,8CAKC;AAGD,8CAEC;AAxDD;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,MAAM;IACb,iBAAiB,EAAE,MAAM;IACzB,mBAAmB,EAAE,MAAM;IAC3B,gBAAgB,EAAE,MAAM;IACxB,OAAO,EAAE,MAAM;IACf,mBAAmB,EAAE,MAAM;IAC3B,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,QAAQ;CACsC,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,MAAyB,EAA0B,EAAE,CACtE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAmB,CAAC,MAAM,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,MAAM,CACtC,CAAC;AAEJ;;;GAGG;AACU,QAAA,mBAAmB,GAA2B,UAAU,CAAC,MAAM,CAAC,CAAC;AAE9E,+CAA+C;AAClC,QAAA,qBAAqB,GAA2B,UAAU,CAAC,QAAQ,CAAC,CAAC;AAElF;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,MAA+C;IAE/C,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,OAAO,gBAAgB,CAAC,MAAqB,CAAC,IAAI,MAAM,CAAC;AAC3D,CAAC;AAED,4DAA4D;AAC5D,SAAgB,iBAAiB,CAAC,MAA+C;IAC/E,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC;AAC9C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -875,10 +875,16 @@ export interface ListQuotesOptions {
|
|
|
875
875
|
sort?: string;
|
|
876
876
|
q?: string;
|
|
877
877
|
/**
|
|
878
|
-
* `all` returns every status.
|
|
879
|
-
*
|
|
878
|
+
* `all` returns every status. `open` returns only the statuses still in
|
|
879
|
+
* play — `OPEN_QUOTE_STATUSES`, i.e. everything but `awarded`, `lost` and
|
|
880
|
+
* `not_taken`. (5.9.0)
|
|
881
|
+
*
|
|
882
|
+
* Omitting defaults to "not closed": `lost` and `not_taken` are excluded,
|
|
883
|
+
* `awarded` is not. That default is deliberately unchanged — it is what
|
|
884
|
+
* every existing consumer is built on — so a caller that wants awarded
|
|
885
|
+
* quotes out of its list asks for `open` explicitly.
|
|
880
886
|
*/
|
|
881
|
-
status?: QuoteStatus | 'all';
|
|
887
|
+
status?: QuoteStatus | 'all' | 'open';
|
|
882
888
|
quality?: 'draft' | 'verified';
|
|
883
889
|
customerCompanyId?: string;
|
|
884
890
|
programId?: string;
|
|
@@ -2212,20 +2218,116 @@ export interface ExchangeRate {
|
|
|
2212
2218
|
createdAt: string;
|
|
2213
2219
|
updatedAt: string;
|
|
2214
2220
|
}
|
|
2215
|
-
|
|
2221
|
+
/**
|
|
2222
|
+
* The rate half of a create/update. Supply EXACTLY ONE of `perUsd` (the stored
|
|
2223
|
+
* unit) or `perBase` (units per 1 `base`, converted to per-USD on write).
|
|
2224
|
+
* Supplying both is a 422 rather than a silent preference.
|
|
2225
|
+
*
|
|
2226
|
+
* Base-relative entry exists because a tenant whose base is EUR holds a
|
|
2227
|
+
* EUR-relative feed. The conversion is server-side, `perBase × perUsd(base)`
|
|
2228
|
+
* resolved as of the row's own `effectiveFrom`, so the figure that lands is the
|
|
2229
|
+
* one costing would have derived for that date. **Storage is unchanged** —
|
|
2230
|
+
* `ExchangeRate.perUsd` and `FxTable.base: 'USD'` are exactly as before.
|
|
2231
|
+
*/
|
|
2232
|
+
export interface ExchangeRateEntryInput {
|
|
2233
|
+
/** Units of `currency` per 1 USD — the stored unit. */
|
|
2234
|
+
perUsd?: number | string;
|
|
2235
|
+
/** Units of `currency` per 1 `base`. */
|
|
2236
|
+
perBase?: number | string;
|
|
2237
|
+
/**
|
|
2238
|
+
* The unit `perBase` is expressed in. Defaults to the tenant's configured
|
|
2239
|
+
* base currency (see `exchangeRates.settings()`).
|
|
2240
|
+
*
|
|
2241
|
+
* Two rules to know when this is not USD:
|
|
2242
|
+
* - `currency === base` is rejected; a currency is 1 per 1 of itself.
|
|
2243
|
+
* - `currency === 'USD'` is **the anchor**: `perBase(USD)` is `1/perUsd(base)`,
|
|
2244
|
+
* so it restates the base↔USD rate and writes a row for **`base`**, not for
|
|
2245
|
+
* USD. The returned `ExchangeRate` reports the row actually written, so read
|
|
2246
|
+
* `.currency` off the response rather than assuming what you sent.
|
|
2247
|
+
*/
|
|
2248
|
+
base?: string;
|
|
2249
|
+
}
|
|
2250
|
+
export interface CreateExchangeRateInput extends ExchangeRateEntryInput {
|
|
2216
2251
|
currency: string;
|
|
2217
|
-
perUsd: number | string;
|
|
2218
2252
|
/** YYYY-MM-DD. */
|
|
2219
2253
|
effectiveFrom: string;
|
|
2220
2254
|
effectiveTo?: string | null;
|
|
2221
2255
|
notes?: string | null;
|
|
2222
2256
|
}
|
|
2223
|
-
export interface UpdateExchangeRateInput {
|
|
2224
|
-
perUsd?: number | string;
|
|
2257
|
+
export interface UpdateExchangeRateInput extends ExchangeRateEntryInput {
|
|
2225
2258
|
effectiveFrom?: string;
|
|
2226
2259
|
effectiveTo?: string | null;
|
|
2227
2260
|
notes?: string | null;
|
|
2228
2261
|
}
|
|
2262
|
+
/**
|
|
2263
|
+
* A tenant's FX settings. `baseCurrency` is the unit this tenant's people READ
|
|
2264
|
+
* and TYPE rates in — NOT a storage pivot. `/v1/fx/table` still reports
|
|
2265
|
+
* `base: 'USD'` to every consumer regardless of what this says, and no stored
|
|
2266
|
+
* rate changes when it is flipped.
|
|
2267
|
+
*/
|
|
2268
|
+
export interface TenantFxSettings {
|
|
2269
|
+
/** ISO-4217 code. `'USD'` when the tenant has never set one. */
|
|
2270
|
+
baseCurrency: string;
|
|
2271
|
+
/** False when no row exists yet and this is the platform default. */
|
|
2272
|
+
customized: boolean;
|
|
2273
|
+
}
|
|
2274
|
+
export interface UpdateTenantFxSettingsInput {
|
|
2275
|
+
/** Must be a currency that is enabled in the tenant's catalog. */
|
|
2276
|
+
baseCurrency?: string;
|
|
2277
|
+
}
|
|
2278
|
+
export type CurrencyScope = 'global' | 'tenant';
|
|
2279
|
+
/**
|
|
2280
|
+
* One entry in a tenant's effective currency catalog.
|
|
2281
|
+
*
|
|
2282
|
+
* Mixed tenancy, the same shape as ExchangeRate: the platform seeds the active
|
|
2283
|
+
* ISO-4217 set as shared rows, and a tenant row for the same code shadows one
|
|
2284
|
+
* to rename or hide it for that tenant alone. A tenant row for a code the seed
|
|
2285
|
+
* does not carry is a custom currency.
|
|
2286
|
+
*
|
|
2287
|
+
* `active` is CURATION, not deletion. 155 codes is a useless picker, so a
|
|
2288
|
+
* tenant turns off what it does not trade in. It never invalidates history:
|
|
2289
|
+
* membership is enforced only on NEW writes, so rates already written against
|
|
2290
|
+
* a code keep resolving.
|
|
2291
|
+
*/
|
|
2292
|
+
export interface Currency {
|
|
2293
|
+
/** ISO-4217 code, uppercase. */
|
|
2294
|
+
code: string;
|
|
2295
|
+
name: string;
|
|
2296
|
+
symbol: string | null;
|
|
2297
|
+
/** ISO-4217 exponent. Drives money FORMATTING only — rates are 6-dp decimals. */
|
|
2298
|
+
minorUnits: number;
|
|
2299
|
+
active: boolean;
|
|
2300
|
+
/** Which row won: `tenant` when this tenant authored or overrode it. */
|
|
2301
|
+
scope: CurrencyScope;
|
|
2302
|
+
/** True when a tenant row shadows a seeded global of the same code. */
|
|
2303
|
+
overridesGlobal: boolean;
|
|
2304
|
+
/** True when only this tenant has it — not part of the seeded ISO set. */
|
|
2305
|
+
custom: boolean;
|
|
2306
|
+
}
|
|
2307
|
+
export interface ListCurrenciesOptions {
|
|
2308
|
+
/** Default true. Pass false for just the enabled ones — what a picker wants. */
|
|
2309
|
+
includeInactive?: boolean;
|
|
2310
|
+
/** Case-insensitive substring match on code or name. */
|
|
2311
|
+
q?: string;
|
|
2312
|
+
}
|
|
2313
|
+
export interface CreateCurrencyInput {
|
|
2314
|
+
code: string;
|
|
2315
|
+
name: string;
|
|
2316
|
+
symbol?: string | null;
|
|
2317
|
+
/** 0-4. Defaults to 2. */
|
|
2318
|
+
minorUnits?: number;
|
|
2319
|
+
active?: boolean;
|
|
2320
|
+
}
|
|
2321
|
+
export interface UpdateCurrencyInput {
|
|
2322
|
+
name?: string;
|
|
2323
|
+
symbol?: string | null;
|
|
2324
|
+
minorUnits?: number;
|
|
2325
|
+
/**
|
|
2326
|
+
* Enable or hide for this tenant. USD can never be turned off (every rate is
|
|
2327
|
+
* stored against it), and neither can the tenant's own base currency.
|
|
2328
|
+
*/
|
|
2329
|
+
active?: boolean;
|
|
2330
|
+
}
|
|
2229
2331
|
export interface ListExchangeRatesOptions {
|
|
2230
2332
|
limit?: number;
|
|
2231
2333
|
cursor?: string;
|
|
@@ -2811,12 +2913,34 @@ export interface CreateAttributeDefinitionInput {
|
|
|
2811
2913
|
dataType: AttributeDataType;
|
|
2812
2914
|
unit?: string | null;
|
|
2813
2915
|
options?: string[] | null;
|
|
2916
|
+
/** The attribute's values, supplied WITH the definition. One value per entry;
|
|
2917
|
+
* for `hierarchy`, a `Parent > Child > Grandchild` path per entry, which the
|
|
2918
|
+
* server turns into an option tree (shared prefixes dedupe).
|
|
2919
|
+
*
|
|
2920
|
+
* **Required for `enum`, `multi_select` and `hierarchy`** (since 5.10.1) — a
|
|
2921
|
+
* select with no values renders as an empty picker, and marked required it
|
|
2922
|
+
* is a dead end. Legacy inline `options` satisfies the same rule. */
|
|
2923
|
+
optionValues?: string[] | null;
|
|
2814
2924
|
groupId?: string | null;
|
|
2815
2925
|
validation?: AttributeValidationRules | null;
|
|
2816
2926
|
filterable?: boolean;
|
|
2817
2927
|
analyticsVisible?: boolean;
|
|
2818
2928
|
sortOrder?: number;
|
|
2819
2929
|
}
|
|
2930
|
+
/** A starter workbook for a new attribute's values — see `attributeOptions.valuesTemplate`. */
|
|
2931
|
+
export interface AttributeValuesTemplate {
|
|
2932
|
+
filename: string;
|
|
2933
|
+
mimeType: string;
|
|
2934
|
+
contentBase64: string;
|
|
2935
|
+
}
|
|
2936
|
+
/** An uploaded values sheet, parsed but NOT committed — see `attributeOptions.parseValuesFile`. */
|
|
2937
|
+
export interface ParsedAttributeValues {
|
|
2938
|
+
/** One line per value, in the shape `optionValues` takes. */
|
|
2939
|
+
values: string[];
|
|
2940
|
+
errors: string[];
|
|
2941
|
+
/** A hierarchy uploaded with no levels named: the level names read from the sheet's header row. */
|
|
2942
|
+
inferredLevels?: string[];
|
|
2943
|
+
}
|
|
2820
2944
|
export interface UpdateAttributeDefinitionInput {
|
|
2821
2945
|
label?: string;
|
|
2822
2946
|
dataType?: AttributeDataType;
|
|
@@ -3058,7 +3182,7 @@ export type SourceApp = 'master-data' | 'erfq' | 'cpq' | 'bom' | 'forecast' | 'o
|
|
|
3058
3182
|
* "Empty" means SQL NULL only — a stored '', 0, false, or 0.0 counts as
|
|
3059
3183
|
* populated and will not be overwritten by fill_empty. */
|
|
3060
3184
|
export type MergePolicy = 'overwrite' | 'fill_empty';
|
|
3061
|
-
export type ImportTargetField = 'name' | 'legalName' | 'code' | 'taxId' | 'dunsNumber' | 'website' | 'logoUrl' | 'roles' | 'email' | 'phone' | 'role' | 'type' | 'description' | 'street' | 'city' | 'stateProvince' | 'postalCode' | 'country' | 'category' | 'parent_company_ref' | 'companyCode' | 'companyName' | 'locationCode' | 'region' | 'headcount' | 'annualCapacityHours' | 'currentUtilization' | 'riskLevel' | 'numShifts' | 'hoursPerShift' | 'workingDaysPerYear' | 'indirectHeadcountPct' | 'currency' | 'effectiveDate' | 'effectiveTo' | 'libraryCode' | 'kind' | 'plantCode' | 'skillTier' | 'materialCode' | 'regionCode' | 'lane' | 'rate' | 'unit' | 'sourcingMode' | 'indexRef' | 'notes' | 'partNumber' | 'manufacturingPartNumber' | 'customerPartNumber' | 'partType' | 'manufacturer' | 'partCategoryCode' | 'quality' | 'revision' | 'uom' | 'weightPerUnit' | 'recycledPct' | 'pcfPerUnit' | 'releaseStatus' | 'leadTime' | 'customerCompanyCode' | 'customerCompanyName' | 'sopDate' | 'eopDate' | 'displayOrder' | 'label' | 'sortOrder' | 'processFamily' | 'capacityHoursPerYear' | 'cavities' | 'availabilityPct' | 'performancePct' | 'defaultHeadcount' | 'defaultAutomationPct' | 'defaultMachinesPerOperator' | 'defaultSetupCrew' | 'perUsd' | 'effectiveFrom' | 'quoteNumber' | 'programCode' | 'partId' | 'regionName' | 'annualVolume' | 'apw' | 'mpw' | 'targetPrice' | 'dueDate' | 'status' | 'key' | 'dataType' | 'options' | 'group' | 'required' | 'min' | 'max' | 'regex' | 'precision' | 'basis' | 'bindings' | 'perBaseFactor' | 'needsDensity' | 'binding' | 'allowedUoms' | 'defaultUom' | 'escalationDefault' | 'density' | 'densityUnit' | `attr:${string}`;
|
|
3185
|
+
export type ImportTargetField = 'name' | 'legalName' | 'code' | 'taxId' | 'dunsNumber' | 'website' | 'logoUrl' | 'roles' | 'email' | 'phone' | 'role' | 'type' | 'description' | 'street' | 'city' | 'stateProvince' | 'postalCode' | 'country' | 'category' | 'parent_company_ref' | 'companyCode' | 'companyName' | 'locationCode' | 'region' | 'headcount' | 'annualCapacityHours' | 'currentUtilization' | 'riskLevel' | 'numShifts' | 'hoursPerShift' | 'workingDaysPerYear' | 'indirectHeadcountPct' | 'currency' | 'effectiveDate' | 'effectiveTo' | 'libraryCode' | 'kind' | 'plantCode' | 'skillTier' | 'materialCode' | 'regionCode' | 'lane' | 'rate' | 'unit' | 'sourcingMode' | 'indexRef' | 'notes' | 'partNumber' | 'manufacturingPartNumber' | 'customerPartNumber' | 'partType' | 'manufacturer' | 'partCategoryCode' | 'quality' | 'revision' | 'uom' | 'weightPerUnit' | 'recycledPct' | 'pcfPerUnit' | 'releaseStatus' | 'leadTime' | 'customerCompanyCode' | 'customerCompanyName' | 'sopDate' | 'eopDate' | 'displayOrder' | 'label' | 'sortOrder' | 'processFamily' | 'capacityHoursPerYear' | 'cavities' | 'availabilityPct' | 'performancePct' | 'defaultHeadcount' | 'defaultAutomationPct' | 'defaultMachinesPerOperator' | 'defaultSetupCrew' | 'perUsd' | 'base' | 'effectiveFrom' | 'quoteNumber' | 'programCode' | 'partId' | 'regionName' | 'annualVolume' | 'apw' | 'mpw' | 'targetPrice' | 'dueDate' | 'status' | 'key' | 'dataType' | 'options' | 'group' | 'required' | 'min' | 'max' | 'regex' | 'precision' | 'basis' | 'bindings' | 'perBaseFactor' | 'needsDensity' | 'binding' | 'allowedUoms' | 'defaultUom' | 'escalationDefault' | 'density' | 'densityUnit' | `attr:${string}`;
|
|
3062
3186
|
export interface ImportSession {
|
|
3063
3187
|
id: string;
|
|
3064
3188
|
tenantId: string;
|
|
@@ -3774,4 +3898,56 @@ export interface StandardAttributeHistoryEntry {
|
|
|
3774
3898
|
changedAt: string;
|
|
3775
3899
|
changedBy: string;
|
|
3776
3900
|
}
|
|
3901
|
+
/** The settings a call resolves to. Never partial - every field has a value. */
|
|
3902
|
+
export interface AiLlmSettings {
|
|
3903
|
+
provider: string;
|
|
3904
|
+
fallback_chain: string;
|
|
3905
|
+
chat_model: string;
|
|
3906
|
+
structured_model: string;
|
|
3907
|
+
temperature: number;
|
|
3908
|
+
max_tokens: number;
|
|
3909
|
+
structured_max_tokens: number;
|
|
3910
|
+
}
|
|
3911
|
+
/** What one row states. A null means "inherit", not "unset to nothing". */
|
|
3912
|
+
export interface AiLlmConfigFields {
|
|
3913
|
+
provider?: string | null;
|
|
3914
|
+
fallback_chain?: string | null;
|
|
3915
|
+
chat_model?: string | null;
|
|
3916
|
+
structured_model?: string | null;
|
|
3917
|
+
temperature?: number | null;
|
|
3918
|
+
max_tokens?: number | null;
|
|
3919
|
+
structured_max_tokens?: number | null;
|
|
3920
|
+
}
|
|
3921
|
+
export interface AiLlmConfigView {
|
|
3922
|
+
scope: string;
|
|
3923
|
+
feature: string;
|
|
3924
|
+
/** Only this row's own overrides. */
|
|
3925
|
+
overrides: AiLlmConfigFields;
|
|
3926
|
+
/** What Terraform / Parameter Store deployed: the floor. */
|
|
3927
|
+
deployed: AiLlmSettings;
|
|
3928
|
+
/** What a call with this scope and feature actually gets. */
|
|
3929
|
+
effective: AiLlmSettings;
|
|
3930
|
+
updated_by: string | null;
|
|
3931
|
+
updated_at: string | null;
|
|
3932
|
+
suggested_models: Record<string, string[]>;
|
|
3933
|
+
valid_providers: string[];
|
|
3934
|
+
/**
|
|
3935
|
+
* Present on a save. False means the row landed but the cache write did
|
|
3936
|
+
* not, so the change takes effect on the next cache expiry rather than
|
|
3937
|
+
* immediately - worth saying out loud rather than reporting a clean save.
|
|
3938
|
+
*/
|
|
3939
|
+
cache_written?: boolean;
|
|
3940
|
+
}
|
|
3941
|
+
export interface AiLlmConfigRow extends AiLlmConfigFields {
|
|
3942
|
+
scope: string;
|
|
3943
|
+
feature: string;
|
|
3944
|
+
updated_by: string | null;
|
|
3945
|
+
updated_at: string | null;
|
|
3946
|
+
}
|
|
3947
|
+
export interface AiLlmConfigRows {
|
|
3948
|
+
rows: AiLlmConfigRow[];
|
|
3949
|
+
deployed: AiLlmSettings;
|
|
3950
|
+
valid_providers: string[];
|
|
3951
|
+
suggested_models: Record<string, string[]>;
|
|
3952
|
+
}
|
|
3777
3953
|
//# sourceMappingURL=types.d.ts.map
|