@simpleapps-com/augur-api 2026.11.1 → 2026.11.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/index.mjs CHANGED
@@ -1,20 +1,3 @@
1
- // ../utils/src/lists.ts
2
- function joinFrom(xs, sep, i) {
3
- if (i >= xs.length) return "";
4
- if (i === xs.length - 1) return xs[i];
5
- return xs[i] + sep + joinFrom(xs, sep, i + 1);
6
- }
7
- function hasItemFrom(xs, x, i) {
8
- if (i === xs.length) return false;
9
- if (xs[i] === x) return true;
10
- return hasItemFrom(xs, x, i + 1);
11
- }
12
- function notInFrom(xs, allowed, i) {
13
- if (i >= xs.length) return [];
14
- const rest = notInFrom(xs, allowed, i + 1);
15
- return hasItemFrom(allowed, xs[i], 0) ? rest : [xs[i], ...rest];
16
- }
17
-
18
1
  // ../utils/src/chars.ts
19
2
  function isAlnumChar(c) {
20
3
  return c >= 65 && c <= 90 || c >= 97 && c <= 122 || c >= 48 && c <= 57;
@@ -66,6 +49,23 @@ function includesFrom(s, x, i) {
66
49
  return includesFrom(s, x, i + 1);
67
50
  }
68
51
 
52
+ // ../utils/src/lists.ts
53
+ function joinFrom(xs, sep, i) {
54
+ if (i >= xs.length) return "";
55
+ if (i === xs.length - 1) return xs[i];
56
+ return xs[i] + sep + joinFrom(xs, sep, i + 1);
57
+ }
58
+ function hasItemFrom(xs, x, i) {
59
+ if (i === xs.length) return false;
60
+ if (xs[i] === x) return true;
61
+ return hasItemFrom(xs, x, i + 1);
62
+ }
63
+ function notInFrom(xs, allowed, i) {
64
+ if (i >= xs.length) return [];
65
+ const rest = notInFrom(xs, allowed, i + 1);
66
+ return hasItemFrom(allowed, xs[i], 0) ? rest : [xs[i], ...rest];
67
+ }
68
+
69
69
  // ../utils/src/uri.ts
70
70
  function isHigh(c) {
71
71
  return c >= 55296 && c <= 56319;
@@ -809,9 +809,14 @@ function endBefore(k, len) {
809
809
  return k >= 0 ? k : Math.max(len - 1, 0);
810
810
  }
811
811
 
812
+ // ../utils/src/http.ts
813
+ function isPostOrPut(method) {
814
+ return method === "POST" || method === "PUT";
815
+ }
816
+
812
817
  // src/core/registry-rules.ts
813
818
  function hasBodyFor(method) {
814
- return method === "POST" || method === "PUT";
819
+ return isPostOrPut(method);
815
820
  }
816
821
  function isReadEntry(hasReadOnly, readOnly, method) {
817
822
  return hasReadOnly ? readOnly : method === "GET";
@@ -833,12 +838,15 @@ function syncedTotal(total, totalResults) {
833
838
  function syncedTotalResults(total, totalResults) {
834
839
  return totalResults === 0 ? Math.max(total, 0) : totalResults;
835
840
  }
841
+ function warnsOnNormalization(hasEnv, env) {
842
+ return hasEnv && env !== "production";
843
+ }
836
844
 
837
845
  // src/core/schemas.ts
838
846
  var nodeEnv = () => typeof process === "undefined" ? void 0 : process.env?.["NODE_ENV"];
839
847
  var logNormalizationWarning = (message) => {
840
848
  const env = nodeEnv();
841
- if (env !== void 0 && env !== "production") {
849
+ if (warnsOnNormalization(env !== void 0, String(env))) {
842
850
  console.warn(`[augur-api] Response normalization: ${message}`);
843
851
  }
844
852
  };
@@ -1083,7 +1091,8 @@ var SitesP21ApiCreateDataSchema = v2.looseObject({
1083
1091
  clientSecret: v2.nullable(v2.string()),
1084
1092
  writable: v2.boolean()
1085
1093
  })
1086
- )
1094
+ ),
1095
+ env: v2.optional(v2.nullable(v2.picklist(["live", "play"])))
1087
1096
  });
1088
1097
  var SitesStaffTokenCreateDataSchema = v2.looseObject({
1089
1098
  token: v2.string(),
@@ -1111,7 +1120,8 @@ var SitesValidateCreateDataSchema = v2.looseObject({
1111
1120
  database: v2.nullable(v2.string()),
1112
1121
  username: v2.nullable(v2.string()),
1113
1122
  password: v2.nullable(v2.string())
1114
- })
1123
+ }),
1124
+ env: v2.optional(v2.nullable(v2.picklist(["live", "play"])))
1115
1125
  });
1116
1126
  var WorkflowsListDataSchema = v2.array(
1117
1127
  v2.looseObject({
@@ -16831,6 +16841,9 @@ var UsersListParamsSchema2 = v14.looseObject({
16831
16841
  orderBy: v14.optional(v14.string()),
16832
16842
  q: v14.optional(v14.string())
16833
16843
  });
16844
+ var UsersDeleteParamsSchema = v14.looseObject({
16845
+ hardDelete: v14.optional(v14.string())
16846
+ });
16834
16847
  var UsersDocListParamsSchema = v14.looseObject({
16835
16848
  ...EdgeCacheParamsSchema.entries,
16836
16849
  includeShipTo: v14.optional(v14.string())
@@ -17626,10 +17639,13 @@ var endpoints13 = [
17626
17639
  aliases: [],
17627
17640
  pathParams: ["id"],
17628
17641
  pathPatterns: { id: "^\\d+$" },
17629
- queryParams: [],
17642
+ queryParams: ["hardDelete"],
17630
17643
  edgeCache: false,
17631
- summary: "BLOCK user",
17632
- params: { id: { in: "path", type: "integer", required: true } },
17644
+ summary: "Block a user, or delete it permanently",
17645
+ params: {
17646
+ id: { in: "path", type: "integer", required: true },
17647
+ hardDelete: { in: "query", type: "string", required: false }
17648
+ },
17633
17649
  responseSchema: UsersDeleteDataSchema2,
17634
17650
  responseType: "scalar"
17635
17651
  },
@@ -42126,36 +42142,7 @@ var AugurAPI = class _AugurAPI {
42126
42142
  */
42127
42143
  setAuthToken(bearerToken) {
42128
42144
  this.config.bearerToken = bearerToken;
42129
- this._joomla = void 0;
42130
- this._commerce = void 0;
42131
- this._pricing = void 0;
42132
- this._vmi = void 0;
42133
- this._openSearch = void 0;
42134
- this._items = void 0;
42135
- this._legacy = void 0;
42136
- this._agrSite = void 0;
42137
- this._customers = void 0;
42138
- this._orders = void 0;
42139
- this._p21Pim = void 0;
42140
- this._payments = void 0;
42141
- this._agrInfo = void 0;
42142
- this._agrInt = void 0;
42143
- this._agrWork = void 0;
42144
- this._avalara = void 0;
42145
- this._brandFolder = void 0;
42146
- this._googMc = void 0;
42147
- this._gregorovich = void 0;
42148
- this._logistics = void 0;
42149
- this._markets = void 0;
42150
- this._notifications = void 0;
42151
- this._p21Apis = void 0;
42152
- this._p21Core = void 0;
42153
- this._p21Sism = void 0;
42154
- this._shipping = void 0;
42155
- this._smartyStreets = void 0;
42156
- this._ups = void 0;
42157
- this._vendors = void 0;
42158
- this._basecamp2 = void 0;
42145
+ this.resetClients();
42159
42146
  }
42160
42147
  /**
42161
42148
  * Update site ID
@@ -42164,6 +42151,10 @@ var AugurAPI = class _AugurAPI {
42164
42151
  */
42165
42152
  setSiteId(siteId) {
42166
42153
  this.config.siteId = assertSiteId(siteId);
42154
+ this.resetClients();
42155
+ }
42156
+ /** Drops every built service client, so the next access builds it with the current config. */
42157
+ resetClients() {
42167
42158
  this._joomla = void 0;
42168
42159
  this._commerce = void 0;
42169
42160
  this._pricing = void 0;