@simpleapps-com/augur-api 2026.10.16 → 2026.10.18
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/README.md +1 -1
- package/SKILL.md +1 -11
- package/dist/{client-BtWVFwso.d.mts → client-CQsrBGEu.d.mts} +185 -39
- package/dist/{client-BtWVFwso.d.ts → client-CQsrBGEu.d.ts} +185 -39
- package/dist/index.d.mts +31 -4
- package/dist/index.d.ts +31 -4
- package/dist/index.js +246 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +242 -17
- package/dist/index.mjs.map +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,10 @@ __export(index_exports, {
|
|
|
71
71
|
ValidationError: () => ValidationError,
|
|
72
72
|
WhoamiDataSchema: () => WhoamiDataSchema,
|
|
73
73
|
authenticateUserForSite: () => authenticateUserForSite,
|
|
74
|
-
createCrossSiteAuthenticator: () => createCrossSiteAuthenticator
|
|
74
|
+
createCrossSiteAuthenticator: () => createCrossSiteAuthenticator,
|
|
75
|
+
isReadOnly: () => isReadOnly,
|
|
76
|
+
isSiteId: () => isSiteId,
|
|
77
|
+
parseSiteId: () => parseSiteId
|
|
75
78
|
});
|
|
76
79
|
module.exports = __toCommonJS(index_exports);
|
|
77
80
|
|
|
@@ -576,16 +579,99 @@ var HTTPClient = class {
|
|
|
576
579
|
}
|
|
577
580
|
};
|
|
578
581
|
|
|
579
|
-
// src/core/path-
|
|
582
|
+
// src/core/path-encode.ts
|
|
583
|
+
function isHigh(c) {
|
|
584
|
+
return c >= 55296 && c <= 56319;
|
|
585
|
+
}
|
|
586
|
+
function isLow(c) {
|
|
587
|
+
return c >= 56320 && c <= 57343;
|
|
588
|
+
}
|
|
589
|
+
function isUpperHex(c) {
|
|
590
|
+
return c >= 48 && c <= 57 || c >= 65 && c <= 70;
|
|
591
|
+
}
|
|
592
|
+
function isAlnum(c) {
|
|
593
|
+
return c >= 65 && c <= 90 || c >= 97 && c <= 122 || c >= 48 && c <= 57;
|
|
594
|
+
}
|
|
595
|
+
function isMark(c) {
|
|
596
|
+
return c === 45 || c === 46 || c === 95 || c === 126;
|
|
597
|
+
}
|
|
598
|
+
function isDelimOrAt(c) {
|
|
599
|
+
return c === 33 || c === 36 || c >= 38 && c <= 44 || c === 58 || c === 59 || c === 61 || c === 64;
|
|
600
|
+
}
|
|
601
|
+
function isPchar(c) {
|
|
602
|
+
return isAlnum(c) || isMark(c) || isDelimOrAt(c);
|
|
603
|
+
}
|
|
604
|
+
function loneAt(s, k) {
|
|
605
|
+
return isHigh(s.charCodeAt(k)) && !(k + 1 < s.length && isLow(s.charCodeAt(k + 1))) || isLow(s.charCodeAt(k)) && !(k > 0 && isHigh(s.charCodeAt(k - 1)));
|
|
606
|
+
}
|
|
607
|
+
function isPairAt(s, i) {
|
|
608
|
+
return isHigh(s.charCodeAt(i)) && i + 1 < s.length && isLow(s.charCodeAt(i + 1));
|
|
609
|
+
}
|
|
610
|
+
function okAt(s, k) {
|
|
611
|
+
return isPchar(s.charCodeAt(k)) || s.charCodeAt(k) === 37 && k + 2 < s.length && isUpperHex(s.charCodeAt(k + 1)) && isUpperHex(s.charCodeAt(k + 2));
|
|
612
|
+
}
|
|
613
|
+
function hasLoneSurrogate(value) {
|
|
614
|
+
let i = 0;
|
|
615
|
+
while (i < value.length) {
|
|
616
|
+
if (loneAt(value, i)) return true;
|
|
617
|
+
if (isPairAt(value, i)) {
|
|
618
|
+
i = i + 2;
|
|
619
|
+
} else {
|
|
620
|
+
i = i + 1;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
function isEncoded(s) {
|
|
626
|
+
let i = 0;
|
|
627
|
+
while (i < s.length) {
|
|
628
|
+
if (!okAt(s, i)) return false;
|
|
629
|
+
if (s.charCodeAt(i) === 37) {
|
|
630
|
+
i = i + 3;
|
|
631
|
+
} else {
|
|
632
|
+
i = i + 1;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return true;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// src/core/encoded-segment.ts
|
|
580
639
|
var PCHAR_RESTORE_RE = /%(?:24|26|2B|2C|3B|3D|3A|40)/g;
|
|
581
|
-
|
|
582
|
-
|
|
640
|
+
function encodePathSegment(value) {
|
|
641
|
+
const encoded = encodeURIComponent(value).replace(PCHAR_RESTORE_RE, decodeURIComponent);
|
|
642
|
+
if (!isEncoded(encoded)) {
|
|
643
|
+
throw new InvalidArgumentError({
|
|
644
|
+
message: "Encoded path segment has an unexpected shape",
|
|
645
|
+
service: "",
|
|
646
|
+
endpoint: ""
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
return encoded;
|
|
650
|
+
}
|
|
651
|
+
function fillPlaceholder(path, placeholder, segment) {
|
|
652
|
+
return path.split(`{${placeholder}}`).join(segment);
|
|
653
|
+
}
|
|
654
|
+
function renderPath(template, segments) {
|
|
655
|
+
return template.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
656
|
+
const segment = segments[name];
|
|
657
|
+
if (segment === void 0) {
|
|
658
|
+
throw new InvalidArgumentError({
|
|
659
|
+
message: `No path value for {${name}}`,
|
|
660
|
+
service: "",
|
|
661
|
+
endpoint: template
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
return segment;
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// src/core/path-validation.ts
|
|
583
669
|
var pathValueProblem = (value, pattern) => {
|
|
584
670
|
if (pattern !== void 0 && !new RegExp(pattern).test(value)) {
|
|
585
671
|
return `expected a value matching ${pattern}`;
|
|
586
672
|
}
|
|
587
673
|
if (value === "") return "expected a non-empty string";
|
|
588
|
-
return
|
|
674
|
+
return hasLoneSurrogate(value) ? "expected a well-formed string" : void 0;
|
|
589
675
|
};
|
|
590
676
|
var validatePathSegment = (pathTemplate, name, value, pattern, service = "http-client") => {
|
|
591
677
|
const problem = pathValueProblem(value, pattern);
|
|
@@ -7707,6 +7793,20 @@ var ItemCategoryListParamsSchema = v12.looseObject({
|
|
|
7707
7793
|
])
|
|
7708
7794
|
)
|
|
7709
7795
|
});
|
|
7796
|
+
var ItemCategoryXInvMastListParamsSchema = v12.looseObject({
|
|
7797
|
+
...EdgeCacheParamsSchema.entries,
|
|
7798
|
+
invMastUid: v12.optional(v12.pipe(v12.unknown(), v12.transform(Number))),
|
|
7799
|
+
itemCategoryUid: v12.optional(v12.pipe(v12.unknown(), v12.transform(Number))),
|
|
7800
|
+
limit: v12.optional(v12.pipe(v12.unknown(), v12.transform(Number))),
|
|
7801
|
+
offset: v12.optional(v12.pipe(v12.unknown(), v12.transform(Number))),
|
|
7802
|
+
orderBy: v12.optional(v12.string()),
|
|
7803
|
+
statusCd: v12.optional(
|
|
7804
|
+
v12.union([
|
|
7805
|
+
v12.array(v12.pipe(v12.unknown(), v12.transform(Number))),
|
|
7806
|
+
v12.pipe(v12.unknown(), v12.transform(Number))
|
|
7807
|
+
])
|
|
7808
|
+
)
|
|
7809
|
+
});
|
|
7710
7810
|
var ItemCategoryLookupGetParamsSchema = v12.looseObject({
|
|
7711
7811
|
...EdgeCacheParamsSchema.entries,
|
|
7712
7812
|
path: v12.optional(v12.string()),
|
|
@@ -9297,6 +9397,50 @@ var ItemCategoryListDataSchema = v12.array(
|
|
|
9297
9397
|
itemCount: v12.number()
|
|
9298
9398
|
})
|
|
9299
9399
|
);
|
|
9400
|
+
var ItemCategoryXInvMastListDataSchema = v12.array(
|
|
9401
|
+
v12.looseObject({
|
|
9402
|
+
itemCategoryXInvMastUid: v12.number(),
|
|
9403
|
+
itemCategoryUid: v12.number(),
|
|
9404
|
+
invMastUid: v12.number(),
|
|
9405
|
+
sequenceNo: v12.number(),
|
|
9406
|
+
displayOnWebFlag: v12.string(),
|
|
9407
|
+
deleteFlag: v12.string(),
|
|
9408
|
+
dateCreated: v12.string(),
|
|
9409
|
+
createdBy: v12.string(),
|
|
9410
|
+
dateLastModified: v12.string(),
|
|
9411
|
+
lastMaintainedBy: v12.string(),
|
|
9412
|
+
displayDesc: v12.string(),
|
|
9413
|
+
comments: v12.nullable(v12.string()),
|
|
9414
|
+
alternateCodeUid: v12.nullable(v12.number()),
|
|
9415
|
+
updateCd: v12.number(),
|
|
9416
|
+
annualOrders: v12.number(),
|
|
9417
|
+
rank: v12.number(),
|
|
9418
|
+
score: v12.number(),
|
|
9419
|
+
statusCd: v12.number(),
|
|
9420
|
+
processCd: v12.number()
|
|
9421
|
+
})
|
|
9422
|
+
);
|
|
9423
|
+
var ItemCategoryXInvMastGetDataSchema = v12.looseObject({
|
|
9424
|
+
itemCategoryXInvMastUid: v12.number(),
|
|
9425
|
+
itemCategoryUid: v12.number(),
|
|
9426
|
+
invMastUid: v12.number(),
|
|
9427
|
+
sequenceNo: v12.number(),
|
|
9428
|
+
displayOnWebFlag: v12.string(),
|
|
9429
|
+
deleteFlag: v12.string(),
|
|
9430
|
+
dateCreated: v12.string(),
|
|
9431
|
+
createdBy: v12.string(),
|
|
9432
|
+
dateLastModified: v12.string(),
|
|
9433
|
+
lastMaintainedBy: v12.string(),
|
|
9434
|
+
displayDesc: v12.string(),
|
|
9435
|
+
comments: v12.nullable(v12.string()),
|
|
9436
|
+
alternateCodeUid: v12.nullable(v12.number()),
|
|
9437
|
+
updateCd: v12.number(),
|
|
9438
|
+
annualOrders: v12.number(),
|
|
9439
|
+
rank: v12.number(),
|
|
9440
|
+
score: v12.number(),
|
|
9441
|
+
statusCd: v12.number(),
|
|
9442
|
+
processCd: v12.number()
|
|
9443
|
+
});
|
|
9300
9444
|
var ItemCategoryLookupGetDataSchema = v12.looseObject({
|
|
9301
9445
|
itemCategoryUid: v12.number(),
|
|
9302
9446
|
itemCategoryId: v12.string(),
|
|
@@ -11249,6 +11393,43 @@ var endpoints12 = [
|
|
|
11249
11393
|
responseSchema: ItemCategoryListDataSchema,
|
|
11250
11394
|
responseType: "array"
|
|
11251
11395
|
},
|
|
11396
|
+
{
|
|
11397
|
+
method: "GET",
|
|
11398
|
+
path: "/item-category-x-inv-mast",
|
|
11399
|
+
chain: "itemCategoryXInvMast",
|
|
11400
|
+
action: "list",
|
|
11401
|
+
aliases: [],
|
|
11402
|
+
pathParams: [],
|
|
11403
|
+
pathPatterns: {},
|
|
11404
|
+
queryParams: ["invMastUid", "itemCategoryUid", "limit", "offset", "orderBy", "statusCd"],
|
|
11405
|
+
edgeCache: true,
|
|
11406
|
+
summary: "List Item Category Links",
|
|
11407
|
+
params: {
|
|
11408
|
+
invMastUid: { in: "query", type: "integer", required: false },
|
|
11409
|
+
itemCategoryUid: { in: "query", type: "integer", required: false },
|
|
11410
|
+
limit: { in: "query", type: "integer", required: false },
|
|
11411
|
+
offset: { in: "query", type: "integer", required: false },
|
|
11412
|
+
orderBy: { in: "query", type: "string", required: false },
|
|
11413
|
+
statusCd: { in: "query", type: "integer|integer[]", required: false }
|
|
11414
|
+
},
|
|
11415
|
+
responseSchema: ItemCategoryXInvMastListDataSchema,
|
|
11416
|
+
responseType: "array"
|
|
11417
|
+
},
|
|
11418
|
+
{
|
|
11419
|
+
method: "GET",
|
|
11420
|
+
path: "/item-category-x-inv-mast/{itemCategoryXInvMastUid}",
|
|
11421
|
+
chain: "itemCategoryXInvMast",
|
|
11422
|
+
action: "get",
|
|
11423
|
+
aliases: [],
|
|
11424
|
+
pathParams: ["itemCategoryXInvMastUid"],
|
|
11425
|
+
pathPatterns: { itemCategoryXInvMastUid: "^\\d+$" },
|
|
11426
|
+
queryParams: [],
|
|
11427
|
+
edgeCache: true,
|
|
11428
|
+
summary: "Get Item Category Link",
|
|
11429
|
+
params: { itemCategoryXInvMastUid: { in: "path", type: "integer", required: true } },
|
|
11430
|
+
responseSchema: ItemCategoryXInvMastGetDataSchema,
|
|
11431
|
+
responseType: "object"
|
|
11432
|
+
},
|
|
11252
11433
|
{
|
|
11253
11434
|
method: "GET",
|
|
11254
11435
|
path: "/item-category/lookup",
|
|
@@ -22146,6 +22327,9 @@ function resolveEndpoint(id) {
|
|
|
22146
22327
|
index ?? (index = buildIndex());
|
|
22147
22328
|
return index.get(id);
|
|
22148
22329
|
}
|
|
22330
|
+
function isReadOnly(entry) {
|
|
22331
|
+
return entry.readOnly ?? entry.method === "GET";
|
|
22332
|
+
}
|
|
22149
22333
|
|
|
22150
22334
|
// src/core/call.ts
|
|
22151
22335
|
var ENVELOPE_KEYS = [
|
|
@@ -22186,11 +22370,14 @@ function checkArgs(entry, args) {
|
|
|
22186
22370
|
}
|
|
22187
22371
|
}
|
|
22188
22372
|
function fillPath(entry, pathParams) {
|
|
22189
|
-
|
|
22373
|
+
const segments = {};
|
|
22374
|
+
for (const match of entry.path.matchAll(/\{([^}]+)\}/g)) {
|
|
22375
|
+
const name = match[1];
|
|
22190
22376
|
const value = String(pathParams[name]);
|
|
22191
22377
|
validatePathSegment(entry.path, name, value, entry.pathPatterns[name], entry.service);
|
|
22192
|
-
|
|
22193
|
-
}
|
|
22378
|
+
segments[name] = encodePathSegment(value);
|
|
22379
|
+
}
|
|
22380
|
+
return renderPath(entry.path, segments);
|
|
22194
22381
|
}
|
|
22195
22382
|
function toEnvelope(body) {
|
|
22196
22383
|
if (typeof body !== "object" || body === null || Array.isArray(body)) {
|
|
@@ -22219,6 +22406,36 @@ async function callEndpoint(config, id, args = {}) {
|
|
|
22219
22406
|
return { httpStatus: raw.status, envelope: toEnvelope(body), body };
|
|
22220
22407
|
}
|
|
22221
22408
|
|
|
22409
|
+
// src/core/site-id-check.ts
|
|
22410
|
+
function isSiteChar(c) {
|
|
22411
|
+
return c >= 97 && c <= 122 || c >= 48 && c <= 57 || c === 95 || c === 45;
|
|
22412
|
+
}
|
|
22413
|
+
function isSiteId(s) {
|
|
22414
|
+
if (s.length === 0) return false;
|
|
22415
|
+
let i = 0;
|
|
22416
|
+
while (i < s.length) {
|
|
22417
|
+
if (!isSiteChar(s.charCodeAt(i))) return false;
|
|
22418
|
+
i = i + 1;
|
|
22419
|
+
}
|
|
22420
|
+
return true;
|
|
22421
|
+
}
|
|
22422
|
+
|
|
22423
|
+
// src/core/site-id.ts
|
|
22424
|
+
function parseSiteId(value) {
|
|
22425
|
+
return isSiteId(value) ? value : void 0;
|
|
22426
|
+
}
|
|
22427
|
+
function assertSiteId(value) {
|
|
22428
|
+
const site = parseSiteId(value);
|
|
22429
|
+
if (site === void 0) {
|
|
22430
|
+
throw new InvalidArgumentError({
|
|
22431
|
+
message: "Invalid siteId: expected lowercase letters, digits, '_' and '-' (e.g. ampro-online)",
|
|
22432
|
+
service: "",
|
|
22433
|
+
endpoint: ""
|
|
22434
|
+
});
|
|
22435
|
+
}
|
|
22436
|
+
return site;
|
|
22437
|
+
}
|
|
22438
|
+
|
|
22222
22439
|
// src/core/common-schemas.ts
|
|
22223
22440
|
var CommonHealthCheckResponseSchema = BaseResponseSchema(HealthCheckDataSchema);
|
|
22224
22441
|
var CommonPingResponseSchema = BaseResponseSchema(PingDataSchema);
|
|
@@ -22388,11 +22605,11 @@ var BaseServiceClient = class {
|
|
|
22388
22605
|
const stringValue = String(value);
|
|
22389
22606
|
if (path.includes(`{${key}}`)) {
|
|
22390
22607
|
validatePathSegment(pathTemplate, key, stringValue, pathPatterns[key], this.serviceName);
|
|
22391
|
-
|
|
22392
|
-
path = path.replace(`{${key}}`, () => encoded);
|
|
22608
|
+
path = fillPlaceholder(path, key, encodePathSegment(stringValue));
|
|
22393
22609
|
} else {
|
|
22394
22610
|
const normKey = normalise(key);
|
|
22395
|
-
|
|
22611
|
+
for (const match of new Set(path.matchAll(/\{([^}]+)\}/g))) {
|
|
22612
|
+
const placeholder = match[1];
|
|
22396
22613
|
if (normalise(placeholder) === normKey) {
|
|
22397
22614
|
validatePathSegment(
|
|
22398
22615
|
pathTemplate,
|
|
@@ -22401,10 +22618,9 @@ var BaseServiceClient = class {
|
|
|
22401
22618
|
pathPatterns[placeholder],
|
|
22402
22619
|
this.serviceName
|
|
22403
22620
|
);
|
|
22404
|
-
|
|
22621
|
+
path = fillPlaceholder(path, placeholder, encodePathSegment(stringValue));
|
|
22405
22622
|
}
|
|
22406
|
-
|
|
22407
|
-
});
|
|
22623
|
+
}
|
|
22408
22624
|
}
|
|
22409
22625
|
}
|
|
22410
22626
|
return path;
|
|
@@ -22689,6 +22905,7 @@ var ItemsClient = class extends BaseServiceClient {
|
|
|
22689
22905
|
this.invMastSubParts = proxy.invMastSubParts;
|
|
22690
22906
|
this.invMastUd = proxy.invMastUd;
|
|
22691
22907
|
this.itemCategory = proxy.itemCategory;
|
|
22908
|
+
this.itemCategoryXInvMast = proxy.itemCategoryXInvMast;
|
|
22692
22909
|
this.itemFavorites = proxy.itemFavorites;
|
|
22693
22910
|
this.itemUom = proxy.itemUom;
|
|
22694
22911
|
this.itemWishlist = proxy.itemWishlist;
|
|
@@ -22707,6 +22924,7 @@ var ItemsClient = class extends BaseServiceClient {
|
|
|
22707
22924
|
this.invMastSubPartsData = dataProxy.invMastSubParts;
|
|
22708
22925
|
this.invMastUdData = dataProxy.invMastUd;
|
|
22709
22926
|
this.itemCategoryData = dataProxy.itemCategory;
|
|
22927
|
+
this.itemCategoryXInvMastData = dataProxy.itemCategoryXInvMast;
|
|
22710
22928
|
this.itemFavoritesData = dataProxy.itemFavorites;
|
|
22711
22929
|
this.itemUomData = dataProxy.itemUom;
|
|
22712
22930
|
this.itemWishlistData = dataProxy.itemWishlist;
|
|
@@ -23165,8 +23383,14 @@ var Basecamp2Client = class extends BaseServiceClient {
|
|
|
23165
23383
|
|
|
23166
23384
|
// src/client.ts
|
|
23167
23385
|
var _AugurAPI = class _AugurAPI {
|
|
23386
|
+
/**
|
|
23387
|
+
* @throws InvalidArgumentError when `config.siteId` is not a siteId (`isSiteId`: lowercase
|
|
23388
|
+
* letters, digits, `_` and `-`). The config is copied, so changing the caller's object
|
|
23389
|
+
* afterwards cannot put an empty or malformed one into `x-site-id`; use `setSiteId`.
|
|
23390
|
+
*/
|
|
23168
23391
|
constructor(config) {
|
|
23169
|
-
|
|
23392
|
+
assertSiteId(config.siteId);
|
|
23393
|
+
this.config = { ...config };
|
|
23170
23394
|
}
|
|
23171
23395
|
/**
|
|
23172
23396
|
* Every endpoint the SDK exposes, one language-neutral entry each, sorted by id.
|
|
@@ -23545,9 +23769,10 @@ var _AugurAPI = class _AugurAPI {
|
|
|
23545
23769
|
/**
|
|
23546
23770
|
* Update site ID
|
|
23547
23771
|
* @param siteId New site ID
|
|
23772
|
+
* @throws InvalidArgumentError when it is not a siteId (see the constructor)
|
|
23548
23773
|
*/
|
|
23549
23774
|
setSiteId(siteId) {
|
|
23550
|
-
this.config.siteId = siteId;
|
|
23775
|
+
this.config.siteId = assertSiteId(siteId);
|
|
23551
23776
|
this._joomla = void 0;
|
|
23552
23777
|
this._commerce = void 0;
|
|
23553
23778
|
this._pricing = void 0;
|
|
@@ -23635,7 +23860,7 @@ function createCrossSiteAuthenticator(augurInfoToken) {
|
|
|
23635
23860
|
}
|
|
23636
23861
|
|
|
23637
23862
|
// src/index.ts
|
|
23638
|
-
var VERSION = "2026.10.
|
|
23863
|
+
var VERSION = "2026.10.18";
|
|
23639
23864
|
// Annotate the CommonJS export names for ESM import in node:
|
|
23640
23865
|
0 && (module.exports = {
|
|
23641
23866
|
AgrInfoClient,
|
|
@@ -23679,6 +23904,9 @@ var VERSION = "2026.10.16";
|
|
|
23679
23904
|
ValidationError,
|
|
23680
23905
|
WhoamiDataSchema,
|
|
23681
23906
|
authenticateUserForSite,
|
|
23682
|
-
createCrossSiteAuthenticator
|
|
23907
|
+
createCrossSiteAuthenticator,
|
|
23908
|
+
isReadOnly,
|
|
23909
|
+
isSiteId,
|
|
23910
|
+
parseSiteId
|
|
23683
23911
|
});
|
|
23684
23912
|
//# sourceMappingURL=index.js.map
|