@campfire-interactive/master-data-client 5.23.0 → 5.26.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/equipment.d.ts +9 -1
- package/dist/equipment.d.ts.map +1 -1
- package/dist/equipment.js +12 -0
- package/dist/equipment.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +1 -0
- package/dist/parts.js.map +1 -1
- package/dist/quotes.d.ts +11 -1
- package/dist/quotes.d.ts.map +1 -1
- package/dist/quotes.js +21 -0
- package/dist/quotes.js.map +1 -1
- package/dist/scopeGate.d.ts +103 -0
- package/dist/scopeGate.d.ts.map +1 -0
- package/dist/scopeGate.js +155 -0
- package/dist/scopeGate.js.map +1 -0
- package/dist/standardAttributes.d.ts +80 -0
- package/dist/standardAttributes.d.ts.map +1 -0
- package/dist/standardAttributes.js +188 -0
- package/dist/standardAttributes.js.map +1 -0
- package/dist/types.d.ts +76 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +31 -31
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { HttpTransport } from './http';
|
|
2
|
+
import type { StandardAttribute, CreateStandardAttributeInput, CreateStandardAttributeDefaultInput, UpdateStandardAttributeInput, StandardAttributeValue, SetStandardAttributeValueInput, SetStandardAttributeValueResult, StandardAttributeHistoryEntry, StandardAttributeDefault, UpdateStandardAttributeDefaultInput, SingleResponse, ListResponse } from './types';
|
|
3
|
+
export declare class StandardAttributeResource {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpTransport);
|
|
6
|
+
/** Add an attribute to THIS TENANT. Filled by a person — the enrichment
|
|
7
|
+
* pass only knows the platform catalog. */
|
|
8
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
9
|
+
create(input: CreateStandardAttributeInput, idempotencyKey?: string): Promise<SingleResponse<StandardAttribute>>;
|
|
10
|
+
/** ARCHIVE one. It stops being offered and every value already recorded
|
|
11
|
+
* against it stays readable — so this never conflicts with what is stored,
|
|
12
|
+
* and it is reversible. */
|
|
13
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
14
|
+
archive(id: string): Promise<SingleResponse<StandardAttribute>>;
|
|
15
|
+
/** This tenant's attribute catalog, in display order. */
|
|
16
|
+
list(options?: {
|
|
17
|
+
enabledOnly?: boolean;
|
|
18
|
+
}): Promise<ListResponse<StandardAttribute>>;
|
|
19
|
+
/** Rename, reorder, enable or disable one attribute. `key` is immutable. */
|
|
20
|
+
update(id: string, input: UpdateStandardAttributeInput, idempotencyKey?: string): Promise<SingleResponse<StandardAttribute>>;
|
|
21
|
+
/**
|
|
22
|
+
* Quote ids whose attribute VALUES match free text.
|
|
23
|
+
*
|
|
24
|
+
* Prefer `quotes.list({ q })` — it matches these too, and it filters the page,
|
|
25
|
+
* so the count and the cursor agree with what you get. Reach for this only
|
|
26
|
+
* when you are narrowing an already-fetched list in a browser and need to know
|
|
27
|
+
* which rows matched on an attribute rather than on a visible column.
|
|
28
|
+
*
|
|
29
|
+
* Enabled, active attributes only: one switched off or archived is not offered
|
|
30
|
+
* on a quote, so a row returned because it matched one would be returned for a
|
|
31
|
+
* reason the user cannot see anywhere on screen.
|
|
32
|
+
*/
|
|
33
|
+
searchQuoteIds(q: string): Promise<SingleResponse<{
|
|
34
|
+
ids: string[];
|
|
35
|
+
}>>;
|
|
36
|
+
/** Every stored value on one quote, in catalog order. */
|
|
37
|
+
listValues(quoteId: string): Promise<ListResponse<StandardAttributeValue>>;
|
|
38
|
+
/**
|
|
39
|
+
* Write values on a quote.
|
|
40
|
+
*
|
|
41
|
+
* Send the whole set in one call rather than looping: the server writes them
|
|
42
|
+
* in a single transaction, and `onlyIfBlank` on each input is what makes the
|
|
43
|
+
* enrichment pass fill blanks without ever overwriting a rep's correction.
|
|
44
|
+
*/
|
|
45
|
+
setValues(quoteId: string, values: SetStandardAttributeValueInput[], idempotencyKey?: string): Promise<ListResponse<SetStandardAttributeValueResult>>;
|
|
46
|
+
/** Every stored value on one opportunity, in catalog order. */
|
|
47
|
+
listOpportunityValues(opportunityId: string): Promise<ListResponse<StandardAttributeValue>>;
|
|
48
|
+
/** Write values on an opportunity. Send the whole set in one call. */
|
|
49
|
+
setOpportunityValues(opportunityId: string, values: SetStandardAttributeValueInput[], idempotencyKey?: string): Promise<ListResponse<SetStandardAttributeValueResult>>;
|
|
50
|
+
/** One attribute's timeline on an opportunity, or the whole one's when no key. */
|
|
51
|
+
listOpportunityHistory(opportunityId: string, key?: string): Promise<ListResponse<StandardAttributeHistoryEntry>>;
|
|
52
|
+
/** One attribute's timeline on a quote, or the whole quote's when no key. */
|
|
53
|
+
listHistory(quoteId: string, key?: string): Promise<ListResponse<StandardAttributeHistoryEntry>>;
|
|
54
|
+
/** Add an attribute to the PLATFORM catalog. Seeds NEW tenants only —
|
|
55
|
+
* tenants already provisioned keep the copy they have. */
|
|
56
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
57
|
+
createDefault(input: CreateStandardAttributeDefaultInput, idempotencyKey?: string): Promise<SingleResponse<StandardAttributeDefault>>;
|
|
58
|
+
/** Stop seeding one into new tenants. Existing tenant copies and every value
|
|
59
|
+
* ever recorded against the key are untouched. */
|
|
60
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
61
|
+
removeDefault(id: string): Promise<SingleResponse<{
|
|
62
|
+
id: string;
|
|
63
|
+
}>>;
|
|
64
|
+
/**
|
|
65
|
+
* The PLATFORM-wide defaults, in display order — what a new tenant's copy is
|
|
66
|
+
* seeded from. Readable by any tenant; only the platform tenant can write.
|
|
67
|
+
*/
|
|
68
|
+
listDefaults(): Promise<ListResponse<StandardAttributeDefault>>;
|
|
69
|
+
/**
|
|
70
|
+
* Rename or reorder one platform default.
|
|
71
|
+
*
|
|
72
|
+
* Changes what the NEXT tenant is seeded with. It does not reach tenants
|
|
73
|
+
* already provisioned — their copy is theirs to name.
|
|
74
|
+
*
|
|
75
|
+
* `key` is immutable — it is what every stored value references.
|
|
76
|
+
*/
|
|
77
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
78
|
+
updateDefault(id: string, input: UpdateStandardAttributeDefaultInput, idempotencyKey?: string): Promise<SingleResponse<StandardAttributeDefault>>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=standardAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardAttributes.d.ts","sourceRoot":"","sources":["../src/standardAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,EAC5B,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,mCAAmC,EACnC,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AAUjB,qBAAa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;gDAC4C;IAC5C,gNAAgN;IAC1M,MAAM,CACV,KAAK,EAAE,4BAA4B,EACnC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAS7C;;gCAE4B;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EAA6E;IACvE,WAAW,CACf,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;IAUvD;+DAC2D;IAC3D,gNAAgN;IAC1M,aAAa,CACjB,KAAK,EAAE,mCAAmC,EAC1C,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;IASpD;uDACmD;IACnD,gNAAgN;IAC1M,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAOxE;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;IAOrE;;;;;;;OAOG;IACH,gNAAgN;IAC1M,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,mCAAmC,EAC1C,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;CAQrD"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StandardAttributeResource = void 0;
|
|
4
|
+
// Standard Attributes: the platform-owned set of vehicle and program facts a
|
|
5
|
+
// quote carries, each with the source it came from and a full change history.
|
|
6
|
+
// See nextgen docs/decisions/2026-09-18-standard-attributes.md.
|
|
7
|
+
//
|
|
8
|
+
// The catalog is landlord-owned and provisioned per tenant, and a tenant can
|
|
9
|
+
// add its own beside the seeded ones. Nothing is ever destroyed: a tenant
|
|
10
|
+
// ARCHIVES an attribute, which stops it being offered and leaves every recorded
|
|
11
|
+
// value readable. `key` is immutable throughout.
|
|
12
|
+
class StandardAttributeResource {
|
|
13
|
+
http;
|
|
14
|
+
constructor(http) {
|
|
15
|
+
this.http = http;
|
|
16
|
+
}
|
|
17
|
+
/** Add an attribute to THIS TENANT. Filled by a person — the enrichment
|
|
18
|
+
* pass only knows the platform catalog. */
|
|
19
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
20
|
+
async create(input, idempotencyKey) {
|
|
21
|
+
return this.http.request({
|
|
22
|
+
method: 'POST',
|
|
23
|
+
path: '/v1/standard-attributes',
|
|
24
|
+
body: input,
|
|
25
|
+
idempotencyKey,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** ARCHIVE one. It stops being offered and every value already recorded
|
|
29
|
+
* against it stays readable — so this never conflicts with what is stored,
|
|
30
|
+
* and it is reversible. */
|
|
31
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
32
|
+
async archive(id) {
|
|
33
|
+
return this.http.request({
|
|
34
|
+
method: 'DELETE',
|
|
35
|
+
path: `/v1/standard-attributes/${encodeURIComponent(id)}`,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** This tenant's attribute catalog, in display order. */
|
|
39
|
+
async list(options) {
|
|
40
|
+
const query = options?.enabledOnly ? '?enabledOnly=true' : '';
|
|
41
|
+
return this.http.request({
|
|
42
|
+
method: 'GET',
|
|
43
|
+
path: `/v1/standard-attributes${query}`,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/** Rename, reorder, enable or disable one attribute. `key` is immutable. */
|
|
47
|
+
async update(id, input, idempotencyKey) {
|
|
48
|
+
return this.http.request({
|
|
49
|
+
method: 'PATCH',
|
|
50
|
+
path: `/v1/standard-attributes/${encodeURIComponent(id)}`,
|
|
51
|
+
body: input,
|
|
52
|
+
idempotencyKey,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Quote ids whose attribute VALUES match free text.
|
|
57
|
+
*
|
|
58
|
+
* Prefer `quotes.list({ q })` — it matches these too, and it filters the page,
|
|
59
|
+
* so the count and the cursor agree with what you get. Reach for this only
|
|
60
|
+
* when you are narrowing an already-fetched list in a browser and need to know
|
|
61
|
+
* which rows matched on an attribute rather than on a visible column.
|
|
62
|
+
*
|
|
63
|
+
* Enabled, active attributes only: one switched off or archived is not offered
|
|
64
|
+
* on a quote, so a row returned because it matched one would be returned for a
|
|
65
|
+
* reason the user cannot see anywhere on screen.
|
|
66
|
+
*/
|
|
67
|
+
async searchQuoteIds(q) {
|
|
68
|
+
return this.http.request({
|
|
69
|
+
method: 'GET',
|
|
70
|
+
path: `/v1/standard-attributes/search?q=${encodeURIComponent(q)}`,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Every stored value on one quote, in catalog order. */
|
|
74
|
+
async listValues(quoteId) {
|
|
75
|
+
return this.http.request({
|
|
76
|
+
method: 'GET',
|
|
77
|
+
path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Write values on a quote.
|
|
82
|
+
*
|
|
83
|
+
* Send the whole set in one call rather than looping: the server writes them
|
|
84
|
+
* in a single transaction, and `onlyIfBlank` on each input is what makes the
|
|
85
|
+
* enrichment pass fill blanks without ever overwriting a rep's correction.
|
|
86
|
+
*/
|
|
87
|
+
async setValues(quoteId, values, idempotencyKey) {
|
|
88
|
+
return this.http.request({
|
|
89
|
+
method: 'PUT',
|
|
90
|
+
path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes`,
|
|
91
|
+
body: { values },
|
|
92
|
+
idempotencyKey,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// ── The same three, against an opportunity ────────────────────────────────
|
|
96
|
+
//
|
|
97
|
+
// An opportunity's Program & Vehicle values used to be resolved live and
|
|
98
|
+
// stored nowhere, so there was no home for a value somebody typed or for a
|
|
99
|
+
// migration to land. These give it the same store a quote has.
|
|
100
|
+
//
|
|
101
|
+
// The opportunity is an OMSF record; master-data holds the values against a
|
|
102
|
+
// loose id and does not check that it names anything. Values on an
|
|
103
|
+
// opportunity are independent of its quotes' — a quote copies at create via
|
|
104
|
+
// the enrichment pass and then diverges, so that an approver's figures cannot
|
|
105
|
+
// move because somebody edited the opportunity.
|
|
106
|
+
/** Every stored value on one opportunity, in catalog order. */
|
|
107
|
+
async listOpportunityValues(opportunityId) {
|
|
108
|
+
return this.http.request({
|
|
109
|
+
method: 'GET',
|
|
110
|
+
path: `/v1/opportunities/${encodeURIComponent(opportunityId)}/standard-attributes`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** Write values on an opportunity. Send the whole set in one call. */
|
|
114
|
+
async setOpportunityValues(opportunityId, values, idempotencyKey) {
|
|
115
|
+
return this.http.request({
|
|
116
|
+
method: 'PUT',
|
|
117
|
+
path: `/v1/opportunities/${encodeURIComponent(opportunityId)}/standard-attributes`,
|
|
118
|
+
body: { values },
|
|
119
|
+
idempotencyKey,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** One attribute's timeline on an opportunity, or the whole one's when no key. */
|
|
123
|
+
async listOpportunityHistory(opportunityId, key) {
|
|
124
|
+
const query = key ? `?key=${encodeURIComponent(key)}` : '';
|
|
125
|
+
return this.http.request({
|
|
126
|
+
method: 'GET',
|
|
127
|
+
path: `/v1/opportunities/${encodeURIComponent(opportunityId)}/standard-attributes/history${query}`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/** One attribute's timeline on a quote, or the whole quote's when no key. */
|
|
131
|
+
async listHistory(quoteId, key) {
|
|
132
|
+
const query = key ? `?key=${encodeURIComponent(key)}` : '';
|
|
133
|
+
return this.http.request({
|
|
134
|
+
method: 'GET',
|
|
135
|
+
path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes/history${query}`,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// ── The landlord catalog ───────────────────────────────────────────────────
|
|
139
|
+
/** Add an attribute to the PLATFORM catalog. Seeds NEW tenants only —
|
|
140
|
+
* tenants already provisioned keep the copy they have. */
|
|
141
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
142
|
+
async createDefault(input, idempotencyKey) {
|
|
143
|
+
return this.http.request({
|
|
144
|
+
method: 'POST',
|
|
145
|
+
path: '/v1/standard-attribute-defaults',
|
|
146
|
+
body: input,
|
|
147
|
+
idempotencyKey,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/** Stop seeding one into new tenants. Existing tenant copies and every value
|
|
151
|
+
* ever recorded against the key are untouched. */
|
|
152
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
153
|
+
async removeDefault(id) {
|
|
154
|
+
return this.http.request({
|
|
155
|
+
method: 'DELETE',
|
|
156
|
+
path: `/v1/standard-attribute-defaults/${encodeURIComponent(id)}`,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The PLATFORM-wide defaults, in display order — what a new tenant's copy is
|
|
161
|
+
* seeded from. Readable by any tenant; only the platform tenant can write.
|
|
162
|
+
*/
|
|
163
|
+
async listDefaults() {
|
|
164
|
+
return this.http.request({
|
|
165
|
+
method: 'GET',
|
|
166
|
+
path: '/v1/standard-attribute-defaults',
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Rename or reorder one platform default.
|
|
171
|
+
*
|
|
172
|
+
* Changes what the NEXT tenant is seeded with. It does not reach tenants
|
|
173
|
+
* already provisioned — their copy is theirs to name.
|
|
174
|
+
*
|
|
175
|
+
* `key` is immutable — it is what every stored value references.
|
|
176
|
+
*/
|
|
177
|
+
/** @deprecated Since 5.13.0 the server answers 410 Gone: standard attributes are default definitions, authored in `client.defaultAttributes` and switched per tenant with `attributeDefinitions.setEnabled`. */
|
|
178
|
+
async updateDefault(id, input, idempotencyKey) {
|
|
179
|
+
return this.http.request({
|
|
180
|
+
method: 'PATCH',
|
|
181
|
+
path: `/v1/standard-attribute-defaults/${encodeURIComponent(id)}`,
|
|
182
|
+
body: input,
|
|
183
|
+
idempotencyKey,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.StandardAttributeResource = StandardAttributeResource;
|
|
188
|
+
//# sourceMappingURL=standardAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardAttributes.js","sourceRoot":"","sources":["../src/standardAttributes.ts"],"names":[],"mappings":";;;AAgBA,6EAA6E;AAC7E,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,gFAAgF;AAChF,iDAAiD;AACjD,MAAa,yBAAyB;IACP;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;gDAC4C;IAC5C,gNAAgN;IAChN,KAAK,CAAC,MAAM,CACV,KAAmC,EACnC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAoC;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED;;gCAE4B;IAC5B,gNAAgN;IAChN,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAoC;YAC1D,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,2BAA2B,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAC1D,CAAC,CAAC;IACL,CAAC;IAED,yDAAyD;IACzD,KAAK,CAAC,IAAI,CAAC,OAAmC;QAC5C,MAAM,KAAK,GAAG,OAAO,EAAE,WAAW,CAAC,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,IAAI,EAAE,cAAc,kBAAkB,CAAC,OAAO,CAAC,+BAA+B,KAAK,EAAE;SACtF,CAAC,CAAC;IACL,CAAC;IAED,8EAA8E;IAE9E;+DAC2D;IAC3D,gNAAgN;IAChN,KAAK,CAAC,aAAa,CACjB,KAA0C,EAC1C,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA2C;YACjE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iCAAiC;YACvC,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED;uDACmD;IACnD,gNAAgN;IAChN,KAAK,CAAC,aAAa,CAAC,EAAU;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAiC;YACvD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,mCAAmC,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAClE,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAyC;YAC/D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iCAAiC;SACxC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,gNAAgN;IAChN,KAAK,CAAC,aAAa,CACjB,EAAU,EACV,KAA0C,EAC1C,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA2C;YACjE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,mCAAmC,kBAAkB,CAAC,EAAE,CAAC,EAAE;YACjE,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;CACF;AA1ND,8DA0NC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -299,6 +299,16 @@ export interface Quote {
|
|
|
299
299
|
effectiveCostBreakdown: unknown;
|
|
300
300
|
/** Quote-level line-item cost detail for OEM cost-form export (4.18.0). */
|
|
301
301
|
effectiveCostDetail: unknown;
|
|
302
|
+
/**
|
|
303
|
+
* "Contract in place" on an awarded quote — see `quotes.setContract`. Null
|
|
304
|
+
* until recorded. A program is Contracted once every quote behind its
|
|
305
|
+
* finished goods has one. (5.26.0)
|
|
306
|
+
*/
|
|
307
|
+
contractedAt: string | null;
|
|
308
|
+
contractedBy: string | null;
|
|
309
|
+
contractReference: string | null;
|
|
310
|
+
/** The signed contract in DMS, when it was filed there. */
|
|
311
|
+
contractDocumentId: string | null;
|
|
302
312
|
effectiveUnitPrice: string | null;
|
|
303
313
|
effectivePriceSource: string | null;
|
|
304
314
|
effectivePriceBasis: string | null;
|
|
@@ -2144,6 +2154,8 @@ export interface Equipment {
|
|
|
2144
2154
|
defaultAutomationPct: number;
|
|
2145
2155
|
defaultMachinesPerOperator: number;
|
|
2146
2156
|
defaultSetupCrew: number;
|
|
2157
|
+
/** Custom-attribute values, keyed by registry definition key (entityType 'equipment'). */
|
|
2158
|
+
attributes: Record<string, unknown>;
|
|
2147
2159
|
active: boolean;
|
|
2148
2160
|
createdAt: string;
|
|
2149
2161
|
updatedAt: string;
|
|
@@ -2161,6 +2173,8 @@ export interface CreateEquipmentInput {
|
|
|
2161
2173
|
defaultAutomationPct?: number;
|
|
2162
2174
|
defaultMachinesPerOperator?: number;
|
|
2163
2175
|
defaultSetupCrew?: number;
|
|
2176
|
+
/** Custom-attribute values, keyed by registry definition key (entityType 'equipment'). On update, keys merge into the stored bag and a null value clears that key. */
|
|
2177
|
+
attributes?: Record<string, unknown>;
|
|
2164
2178
|
active?: boolean;
|
|
2165
2179
|
}
|
|
2166
2180
|
export interface UpdateEquipmentInput {
|
|
@@ -2175,6 +2189,8 @@ export interface UpdateEquipmentInput {
|
|
|
2175
2189
|
defaultAutomationPct?: number;
|
|
2176
2190
|
defaultMachinesPerOperator?: number;
|
|
2177
2191
|
defaultSetupCrew?: number;
|
|
2192
|
+
/** Custom-attribute values, keyed by registry definition key (entityType 'equipment'). On update, keys merge into the stored bag and a null value clears that key. */
|
|
2193
|
+
attributes?: Record<string, unknown>;
|
|
2178
2194
|
active?: boolean;
|
|
2179
2195
|
}
|
|
2180
2196
|
/** Outcome of `equipment.batchUpsert`. A bad row is reported, not fatal — a
|
|
@@ -2805,7 +2821,17 @@ export interface BatchUpsertPartsOptions {
|
|
|
2805
2821
|
* 'overwrite'; cross-app callers should pass 'fill_empty' so they only fill
|
|
2806
2822
|
* blank identity fields rather than clobbering another app's values. */
|
|
2807
2823
|
mergePolicy?: MergePolicy;
|
|
2808
|
-
|
|
2824
|
+
/** How the typed revision fields (uom, weightPerUnit, recycledPct,
|
|
2825
|
+
* pcfPerUnit, releaseStatus, leadTime) are written on a revision that
|
|
2826
|
+
* ALREADY exists. A new revision always takes them from the row.
|
|
2827
|
+
* - 'none' (default): never written, the historical behavior.
|
|
2828
|
+
* - 'fill_empty': written only where the stored value is empty; a different
|
|
2829
|
+
* stored value is kept and listed in `revisionFieldsKept`.
|
|
2830
|
+
* - 'overwrite': written whenever the value differs.
|
|
2831
|
+
* An empty incoming value never clears a stored one. */
|
|
2832
|
+
revisionFieldPolicy?: RevisionFieldPolicy;
|
|
2833
|
+
}
|
|
2834
|
+
export type RevisionFieldPolicy = 'none' | 'fill_empty' | 'overwrite';
|
|
2809
2835
|
/** Per-row outcome from a parts batch upsert. 'mergedFields' / 'untouched' only
|
|
2810
2836
|
* occur under mergePolicy='fill_empty'. `revisionCreated` is true when the row
|
|
2811
2837
|
* carried a `revision` that didn't already exist on the part. `filledFields`
|
|
@@ -2823,6 +2849,29 @@ export interface BatchPartItemResult {
|
|
|
2823
2849
|
/** Top-level attribute keys merged on an existing revision bag (key-level
|
|
2824
2850
|
* attributes merge). */
|
|
2825
2851
|
mergedAttributeKeys?: string[];
|
|
2852
|
+
/** The revision this row named, found or created. Link a line to this, not
|
|
2853
|
+
* to `data.currentRevisionId`, which is the part as loaded before the
|
|
2854
|
+
* revision step (the previous current revision when the row just created
|
|
2855
|
+
* one). null when the row names no revision, the revision is archived, or
|
|
2856
|
+
* the row errored. Absent from servers older than this field. */
|
|
2857
|
+
partRevisionId?: string | null;
|
|
2858
|
+
/** Typed fields written on an existing revision under `revisionFieldPolicy`. */
|
|
2859
|
+
revisionFieldsSet?: string[];
|
|
2860
|
+
/** Typed fields not written because 'fill_empty' found a different stored
|
|
2861
|
+
* value: the catalog kept its value. */
|
|
2862
|
+
revisionFieldsKept?: Array<{
|
|
2863
|
+
field: string;
|
|
2864
|
+
stored: unknown;
|
|
2865
|
+
incoming: unknown;
|
|
2866
|
+
}>;
|
|
2867
|
+
/** Typed fields dropped from this row for failing a range check (weight,
|
|
2868
|
+
* PCF and lead time 0 or more, lead time whole days, recycled % 0 to 100).
|
|
2869
|
+
* The row itself still resolves. */
|
|
2870
|
+
rejectedFields?: Array<{
|
|
2871
|
+
field: string;
|
|
2872
|
+
value: unknown;
|
|
2873
|
+
reason: string;
|
|
2874
|
+
}>;
|
|
2826
2875
|
}
|
|
2827
2876
|
export interface BatchUpsertPartsResult {
|
|
2828
2877
|
results: BatchPartItemResult[];
|
|
@@ -3634,6 +3683,23 @@ export type BatchChildItemResult = {
|
|
|
3634
3683
|
code: string;
|
|
3635
3684
|
details?: unknown[];
|
|
3636
3685
|
};
|
|
3686
|
+
/** An equipment import row. `updated` means the machine already existed and the row's custom-attribute
|
|
3687
|
+
* values were merged into it (nothing else on the machine was touched). */
|
|
3688
|
+
export type BatchEquipmentImportItemResult = BatchChildItemResult | {
|
|
3689
|
+
index: number;
|
|
3690
|
+
status: 'updated';
|
|
3691
|
+
data: unknown;
|
|
3692
|
+
};
|
|
3693
|
+
export interface BatchEquipmentImportResult {
|
|
3694
|
+
results: BatchEquipmentImportItemResult[];
|
|
3695
|
+
/** `updated` is present only when the file merged attributes into existing machines. */
|
|
3696
|
+
summary: {
|
|
3697
|
+
total: number;
|
|
3698
|
+
created: number;
|
|
3699
|
+
errors: number;
|
|
3700
|
+
updated?: number;
|
|
3701
|
+
};
|
|
3702
|
+
}
|
|
3637
3703
|
export interface BatchCreateChildResult {
|
|
3638
3704
|
results: BatchChildItemResult[];
|
|
3639
3705
|
summary: {
|
|
@@ -3693,6 +3759,8 @@ export interface ImportCommitResult {
|
|
|
3693
3759
|
parts?: BatchCreateMaterialsResult;
|
|
3694
3760
|
programs?: BatchCreateChildResult;
|
|
3695
3761
|
partCategories?: BatchCreateChildResult;
|
|
3762
|
+
/** Equipment sheets: new machines created, plus existing machines whose attribute values were merged. */
|
|
3763
|
+
equipment?: BatchEquipmentImportResult;
|
|
3696
3764
|
rateLibraries?: BatchCreateChildResult;
|
|
3697
3765
|
rateEntries?: BatchCreateChildResult;
|
|
3698
3766
|
/** Child rows skipped because their parent failed to commit (contacts /
|
|
@@ -4301,4 +4369,11 @@ export interface PutWorkingCalendarExceptionInput {
|
|
|
4301
4369
|
working?: boolean;
|
|
4302
4370
|
reason: string;
|
|
4303
4371
|
}
|
|
4372
|
+
/** Body of `quotes.setContract` (5.26.0). Both optional; omitted keeps the stored value. */
|
|
4373
|
+
export interface SetQuoteContractInput {
|
|
4374
|
+
/** A contract number or other identifier, as the customer writes it. */
|
|
4375
|
+
reference?: string | null;
|
|
4376
|
+
/** The signed contract's DMS document id. */
|
|
4377
|
+
documentId?: string | null;
|
|
4378
|
+
}
|
|
4304
4379
|
//# sourceMappingURL=types.d.ts.map
|