@campfire-interactive/master-data-client 5.10.1 → 5.11.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 +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -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 +15 -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 +318 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/workSteps.d.ts +64 -0
- package/dist/workSteps.d.ts.map +1 -0
- package/dist/workSteps.js +168 -0
- package/dist/workSteps.js.map +1 -0
- package/package.json +31 -31
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkingCalendarResource = exports.WorkStepEpisodeResource = exports.WorkStepDefinitionResource = void 0;
|
|
4
|
+
// The timeliness ledger. Tenant-scoped server-side; the tenant frame comes from
|
|
5
|
+
// the request's auth, so no tenantId is passed here.
|
|
6
|
+
/**
|
|
7
|
+
* What each step is and how long it should take. Reads never create rows: a
|
|
8
|
+
* tenant that has saved nothing still resolves every step from the platform
|
|
9
|
+
* defaults (`customized: false`, `id: null`).
|
|
10
|
+
*/
|
|
11
|
+
class WorkStepDefinitionResource {
|
|
12
|
+
http;
|
|
13
|
+
constructor(http) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
}
|
|
16
|
+
async list(options) {
|
|
17
|
+
return this.http.request({
|
|
18
|
+
method: 'GET',
|
|
19
|
+
path: '/v1/work-step-definitions',
|
|
20
|
+
query: {
|
|
21
|
+
subjectKind: options?.subjectKind,
|
|
22
|
+
variant: options?.variant,
|
|
23
|
+
includeInactive: options?.includeInactive ? 'true' : undefined,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Save a kind's overrides atomically (owner/admin). Replaying the same save is a no-op. */
|
|
28
|
+
async save(input, idempotencyKey) {
|
|
29
|
+
return this.http.request({
|
|
30
|
+
method: 'PUT',
|
|
31
|
+
path: '/v1/work-step-definitions',
|
|
32
|
+
body: input,
|
|
33
|
+
idempotencyKey,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Copy the platform defaults into the tenant's own rows (owner/admin). Idempotent. */
|
|
37
|
+
async populateDefaults(subjectKind, variant) {
|
|
38
|
+
return this.http.request({
|
|
39
|
+
method: 'POST',
|
|
40
|
+
path: '/v1/work-step-definitions/populate-defaults',
|
|
41
|
+
body: { subjectKind, variant },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.WorkStepDefinitionResource = WorkStepDefinitionResource;
|
|
46
|
+
/**
|
|
47
|
+
* Executions of steps. Every write names the `callerRole` it is made on behalf
|
|
48
|
+
* of; the server checks it against the subject kind (quote: cpq/omsf/admin,
|
|
49
|
+
* vehicle_program: cpq/admin, launch_program: pm/admin).
|
|
50
|
+
*/
|
|
51
|
+
class WorkStepEpisodeResource {
|
|
52
|
+
http;
|
|
53
|
+
constructor(http) {
|
|
54
|
+
this.http = http;
|
|
55
|
+
}
|
|
56
|
+
/** Keyset feed ordered by (updatedAt, id), for the analytics extract and for sweeps. */
|
|
57
|
+
async list(options) {
|
|
58
|
+
return this.http.request({
|
|
59
|
+
method: 'GET',
|
|
60
|
+
path: '/v1/work-step-episodes',
|
|
61
|
+
query: {
|
|
62
|
+
updatedSince: options?.updatedSince,
|
|
63
|
+
subjectType: options?.subjectType,
|
|
64
|
+
stepCode: options?.stepCode,
|
|
65
|
+
limit: options?.limit !== undefined ? String(options.limit) : undefined,
|
|
66
|
+
cursor: options?.cursor,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** One entry per (child, step) with the latest iteration and derived state. */
|
|
71
|
+
async getSeries(subjectType, subjectId) {
|
|
72
|
+
return this.http.request({
|
|
73
|
+
method: 'GET',
|
|
74
|
+
path: `/v1/work-step-episodes/subjects/${encodeURIComponent(subjectType)}/${encodeURIComponent(subjectId)}`,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Open a step. Idempotent: opening an already-open step returns it untouched,
|
|
79
|
+
* so a duplicated event cannot restart the clock. A done step is a 409 -
|
|
80
|
+
* that is {@link reopen}. The iteration is server-assigned.
|
|
81
|
+
*/
|
|
82
|
+
async open(input, idempotencyKey) {
|
|
83
|
+
return this.http.request({
|
|
84
|
+
method: 'POST',
|
|
85
|
+
path: '/v1/work-step-episodes/open',
|
|
86
|
+
body: input,
|
|
87
|
+
idempotencyKey,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Close the latest iteration. Idempotent on a done step. Closing a step that
|
|
92
|
+
* was never opened records a single-ended fact with certainty `recorded`.
|
|
93
|
+
*/
|
|
94
|
+
async close(input, idempotencyKey) {
|
|
95
|
+
return this.http.request({
|
|
96
|
+
method: 'POST',
|
|
97
|
+
path: '/v1/work-step-episodes/close',
|
|
98
|
+
body: input,
|
|
99
|
+
idempotencyKey,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** Start a new iteration of a done step. `reopenReason` is required. */
|
|
103
|
+
async reopen(input, idempotencyKey) {
|
|
104
|
+
return this.http.request({
|
|
105
|
+
method: 'POST',
|
|
106
|
+
path: '/v1/work-step-episodes/reopen',
|
|
107
|
+
body: input,
|
|
108
|
+
idempotencyKey,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Upsert up to 500 episodes on their natural key. Idempotent: an unchanged
|
|
113
|
+
* row is not written (so `updatedAt` does not move), and a stale replay never
|
|
114
|
+
* regresses a done row. This is how an app reports history it already holds
|
|
115
|
+
* (omsf's approval chains, cpq's cutover replay) and how a sweep re-emits.
|
|
116
|
+
*/
|
|
117
|
+
async batch(input, idempotencyKey) {
|
|
118
|
+
return this.http.request({
|
|
119
|
+
method: 'POST',
|
|
120
|
+
path: '/v1/work-step-episodes/batch',
|
|
121
|
+
body: input,
|
|
122
|
+
idempotencyKey,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.WorkStepEpisodeResource = WorkStepEpisodeResource;
|
|
127
|
+
/** A plant's working week and its exceptions. A plant with no calendar is Monday-Friday. */
|
|
128
|
+
class WorkingCalendarResource {
|
|
129
|
+
http;
|
|
130
|
+
constructor(http) {
|
|
131
|
+
this.http = http;
|
|
132
|
+
}
|
|
133
|
+
async list() {
|
|
134
|
+
return this.http.request({ method: 'GET', path: '/v1/working-calendars' });
|
|
135
|
+
}
|
|
136
|
+
async get(productionSourceId) {
|
|
137
|
+
return this.http.request({
|
|
138
|
+
method: 'GET',
|
|
139
|
+
path: `/v1/working-calendars/${encodeURIComponent(productionSourceId)}`,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** Create or update a plant's calendar (owner/admin). An empty `workingDays` is a 422. */
|
|
143
|
+
async upsert(productionSourceId, input, idempotencyKey) {
|
|
144
|
+
return this.http.request({
|
|
145
|
+
method: 'PUT',
|
|
146
|
+
path: `/v1/working-calendars/${encodeURIComponent(productionSourceId)}`,
|
|
147
|
+
body: input,
|
|
148
|
+
idempotencyKey,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** Add or replace the override for one date (owner/admin). Idempotent on (plant, date). */
|
|
152
|
+
async putException(productionSourceId, input, idempotencyKey) {
|
|
153
|
+
return this.http.request({
|
|
154
|
+
method: 'PUT',
|
|
155
|
+
path: `/v1/working-calendars/${encodeURIComponent(productionSourceId)}/exceptions`,
|
|
156
|
+
body: input,
|
|
157
|
+
idempotencyKey,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async deleteException(productionSourceId, date) {
|
|
161
|
+
await this.http.request({
|
|
162
|
+
method: 'DELETE',
|
|
163
|
+
path: `/v1/working-calendars/${encodeURIComponent(productionSourceId)}/exceptions/${encodeURIComponent(date)}`,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.WorkingCalendarResource = WorkingCalendarResource;
|
|
168
|
+
//# sourceMappingURL=workSteps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workSteps.js","sourceRoot":"","sources":["../src/workSteps.ts"],"names":[],"mappings":";;;AAuBA,gFAAgF;AAChF,qDAAqD;AAErD;;;;GAIG;AACH,MAAa,0BAA0B;IACR;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,OAAwC;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAmC;YACzD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,2BAA2B;YACjC,KAAK,EAAE;gBACL,WAAW,EAAE,OAAO,EAAE,WAAW;gBACjC,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,eAAe,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aAC/D;SACF,CAAC,CAAC;IACL,CAAC;IAED,4FAA4F;IAC5F,KAAK,CAAC,IAAI,CACR,KAAmC,EACnC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAmC;YACzD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,K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,EAAE,yBAAyB,kBAAkB,CAAC,kBAAkB,CAAC,EAAE;SACxE,CAAC,CAAC;IACL,CAAC;IAED,0FAA0F;IAC1F,KAAK,CAAC,MAAM,CACV,kBAA0B,EAC1B,KAAiC,EACjC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkC;YACxD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,yBAAyB,kBAAkB,CAAC,kBAAkB,CAAC,EAAE;YACvE,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,2FAA2F;IAC3F,KAAK,CAAC,YAAY,CAChB,kBAA0B,EAC1B,KAAuC,EACvC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA2C;YACjE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,yBAAyB,kBAAkB,CAAC,kBAAkB,CAAC,aAAa;YAClF,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,kBAA0B,EAAE,IAAY;QAC5D,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAY;YACjC,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,yBAAyB,kBAAkB,CAAC,kBAAkB,CAAC,eAAe,kBAAkB,CAAC,IAAI,CAAC,EAAE;SAC/G,CAAC,CAAC;IACL,CAAC;CACF;AAhDD,0DAgDC"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@campfire-interactive/master-data-client",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"description": "TypeScript client for the Master Data Service",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"clean": "rm -rf dist",
|
|
13
|
-
"test": "npm run build && node --test",
|
|
14
|
-
"prepublishOnly": "npm run build"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/Campfire-Interactive/packages.git"
|
|
19
|
-
},
|
|
20
|
-
"publishConfig": {
|
|
21
|
-
"registry": "https://registry.npmjs.org",
|
|
22
|
-
"access": "public"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@types/node": "^25.5.0",
|
|
26
|
-
"typescript": "^5.3.3"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18.0.0"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@campfire-interactive/master-data-client",
|
|
3
|
+
"version": "5.11.0",
|
|
4
|
+
"description": "TypeScript client for the Master Data Service",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"clean": "rm -rf dist",
|
|
13
|
+
"test": "npm run build && node --test",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Campfire-Interactive/packages.git"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"registry": "https://registry.npmjs.org",
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^25.5.0",
|
|
26
|
+
"typescript": "^5.3.3"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|