@simpleapps-com/augur-api 2026.5.4 → 2026.5.6

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/index.mjs CHANGED
@@ -109,6 +109,15 @@ var RateLimitError = class extends AugurError {
109
109
  });
110
110
  }
111
111
  };
112
+ var InvalidArgumentError = class extends AugurError {
113
+ constructor(params) {
114
+ super({
115
+ ...params,
116
+ code: "INVALID_ARGUMENT",
117
+ statusCode: 400
118
+ });
119
+ }
120
+ };
112
121
 
113
122
  // src/core/client.ts
114
123
  function generateRequestKey(method, url, params) {
@@ -431,6 +440,39 @@ var HTTPClient = class {
431
440
  }
432
441
  };
433
442
 
443
+ // src/core/path-validation.ts
444
+ var normalise = (name) => name.replace(/[-_]/g, "").toLowerCase();
445
+ var NUMERIC_EXACT = /* @__PURE__ */ new Set(["id", "linenumber"]);
446
+ var NUMERIC_SUFFIX_RE = /(?:id|uid|no|num|number)$/;
447
+ var STRING_OVERRIDES = /* @__PURE__ */ new Set(["siteid", "pono", "importuid", "scheduledimportmasteruid"]);
448
+ var isNumericPlaceholder = (placeholder) => {
449
+ const normalised = normalise(placeholder);
450
+ if (STRING_OVERRIDES.has(normalised)) return false;
451
+ if (NUMERIC_EXACT.has(normalised)) return true;
452
+ return NUMERIC_SUFFIX_RE.test(normalised);
453
+ };
454
+ var INTEGER_RE = /^-?\d+$/;
455
+ var validatePathSegment = (pathTemplate, placeholder, value) => {
456
+ const isNumeric = isNumericPlaceholder(placeholder);
457
+ if (isNumeric) {
458
+ if (!INTEGER_RE.test(value)) {
459
+ throw new InvalidArgumentError({
460
+ message: `Invalid path parameter '${placeholder}': expected an integer, received ${JSON.stringify(value)}`,
461
+ service: "http-client",
462
+ endpoint: pathTemplate
463
+ });
464
+ }
465
+ return;
466
+ }
467
+ if (value === "") {
468
+ throw new InvalidArgumentError({
469
+ message: `Invalid path parameter '${placeholder}': expected a non-empty string, received ${JSON.stringify(value)}`,
470
+ service: "http-client",
471
+ endpoint: pathTemplate
472
+ });
473
+ }
474
+ };
475
+
434
476
  // src/core/schemas.ts
435
477
  import * as v from "valibot";
436
478
  var logNormalizationWarning = (message) => {
@@ -978,16 +1020,19 @@ Provided parameters: ${JSON.stringify(params, null, 2)}`;
978
1020
  if (!pathParams) {
979
1021
  return pathTemplate;
980
1022
  }
981
- const normalise = (s) => s.replace(/[-_]/g, "").toLowerCase();
1023
+ const normalise2 = (s) => s.replace(/[-_]/g, "").toLowerCase();
982
1024
  let path = pathTemplate;
983
1025
  for (const [key, value] of Object.entries(pathParams)) {
1026
+ const stringValue = String(value);
984
1027
  if (path.includes(`{${key}}`)) {
985
- path = path.replace(`{${key}}`, String(value));
1028
+ validatePathSegment(pathTemplate, key, stringValue);
1029
+ path = path.replace(`{${key}}`, stringValue);
986
1030
  } else {
987
- const normKey = normalise(key);
1031
+ const normKey = normalise2(key);
988
1032
  path = path.replace(/\{([^}]+)\}/g, (match, placeholder) => {
989
- if (normalise(placeholder) === normKey) {
990
- return String(value);
1033
+ if (normalise2(placeholder) === normKey) {
1034
+ validatePathSegment(pathTemplate, placeholder, stringValue);
1035
+ return stringValue;
991
1036
  }
992
1037
  return match;
993
1038
  });
@@ -4226,6 +4271,16 @@ var BrandsDataSchema = v11.looseObject({
4226
4271
  processCd: v11.optional(v11.number()),
4227
4272
  contentId: v11.optional(v11.nullable(v11.number()))
4228
4273
  });
4274
+ var BrandsItemsDataSchema = v11.looseObject({
4275
+ brandsXItemsUid: v11.optional(v11.number()),
4276
+ brandsUid: v11.optional(v11.number()),
4277
+ invMastUid: v11.optional(v11.number()),
4278
+ dateCreated: v11.optional(v11.string()),
4279
+ dateLastModified: v11.optional(v11.string()),
4280
+ updateCd: v11.optional(v11.number()),
4281
+ statusCd: v11.optional(v11.number()),
4282
+ processCd: v11.optional(v11.number())
4283
+ });
4229
4284
  var InvLocDataSchema = v11.looseObject({
4230
4285
  companyId: v11.optional(v11.string()),
4231
4286
  locationId: v11.optional(v11.number()),
@@ -4686,6 +4741,54 @@ var endpoints6 = [
4686
4741
  responseSchema: PassthroughDataSchema6,
4687
4742
  responseType: "passthrough"
4688
4743
  },
4744
+ {
4745
+ method: "POST",
4746
+ path: "/brands/{brandsUid}/items",
4747
+ chain: "brands.items",
4748
+ action: "create",
4749
+ aliases: [],
4750
+ pathParams: ["brandsUid"],
4751
+ queryParams: [],
4752
+ edgeCache: false,
4753
+ responseSchema: BrandsItemsDataSchema,
4754
+ responseType: "object"
4755
+ },
4756
+ {
4757
+ method: "GET",
4758
+ path: "/brands/{brandsUid}/items/{brandsXItemsUid}",
4759
+ chain: "brands.items",
4760
+ action: "get",
4761
+ aliases: [],
4762
+ pathParams: ["brandsUid", "brandsXItemsUid"],
4763
+ queryParams: [],
4764
+ edgeCache: true,
4765
+ responseSchema: BrandsItemsDataSchema,
4766
+ responseType: "object"
4767
+ },
4768
+ {
4769
+ method: "PUT",
4770
+ path: "/brands/{brandsUid}/items/{brandsXItemsUid}",
4771
+ chain: "brands.items",
4772
+ action: "update",
4773
+ aliases: [],
4774
+ pathParams: ["brandsUid", "brandsXItemsUid"],
4775
+ queryParams: [],
4776
+ edgeCache: false,
4777
+ responseSchema: BrandsItemsDataSchema,
4778
+ responseType: "object"
4779
+ },
4780
+ {
4781
+ method: "DELETE",
4782
+ path: "/brands/{brandsUid}/items/{brandsXItemsUid}",
4783
+ chain: "brands.items",
4784
+ action: "delete",
4785
+ aliases: [],
4786
+ pathParams: ["brandsUid", "brandsXItemsUid"],
4787
+ queryParams: [],
4788
+ edgeCache: false,
4789
+ responseSchema: BrandsItemsDataSchema,
4790
+ responseType: "object"
4791
+ },
4689
4792
  {
4690
4793
  method: "GET",
4691
4794
  path: "/categories/lookup",
@@ -14143,7 +14246,7 @@ function createCrossSiteAuthenticator(augurInfoToken) {
14143
14246
  }
14144
14247
 
14145
14248
  // src/index.ts
14146
- var VERSION = "2026.5.4";
14249
+ var VERSION = "2026.5.6";
14147
14250
  export {
14148
14251
  AgrInfoClient,
14149
14252
  AgrSiteClient,
@@ -14160,6 +14263,7 @@ export {
14160
14263
  CustomersClient,
14161
14264
  GregorovichClient,
14162
14265
  HealthCheckDataSchema,
14266
+ InvalidArgumentError,
14163
14267
  ItemsClient,
14164
14268
  JoomlaClient,
14165
14269
  LegacyClient,