@uniformdev/mesh-sdk 20.50.2-alpha.167 → 20.50.2-alpha.180

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.d.mts CHANGED
@@ -2385,16 +2385,6 @@ type MeshLocationUserPermissions =
2385
2385
  | 'ENTRIES_MANAGE_SCHEMA'
2386
2386
  /** Uniform Canvas:AI Prompts:Manage|Create, update, and delete AI prompts */
2387
2387
  | 'PROMPTS_MANAGE_SCHEMA'
2388
- /** Uniform Canvas:Labels:Create */
2389
- | 'LABELS_CREATE'
2390
- /** Uniform Canvas:Labels:Update */
2391
- | 'LABELS_UPDATE'
2392
- /** Uniform Canvas:Labels:Delete */
2393
- | 'LABELS_DELETE'
2394
- /** Uniform Automations:Manage|Create, update, delete, and toggle automations. */
2395
- | 'AUTOMATIONS_MANAGE'
2396
- /** Uniform Canvas:Workflows:Manage|Create, update, and delete workflow definitions. */
2397
- | 'WORKFLOWS_MANAGE'
2398
2388
  /** UTM Mapper:Read|Read UTM mapper configuration */
2399
2389
  | 'UTM_MAPPER_READ'
2400
2390
  /** UTM Mapper:Read|Create, update and delete UTM mapper configuration */
package/dist/index.d.ts CHANGED
@@ -2385,16 +2385,6 @@ type MeshLocationUserPermissions =
2385
2385
  | 'ENTRIES_MANAGE_SCHEMA'
2386
2386
  /** Uniform Canvas:AI Prompts:Manage|Create, update, and delete AI prompts */
2387
2387
  | 'PROMPTS_MANAGE_SCHEMA'
2388
- /** Uniform Canvas:Labels:Create */
2389
- | 'LABELS_CREATE'
2390
- /** Uniform Canvas:Labels:Update */
2391
- | 'LABELS_UPDATE'
2392
- /** Uniform Canvas:Labels:Delete */
2393
- | 'LABELS_DELETE'
2394
- /** Uniform Automations:Manage|Create, update, delete, and toggle automations. */
2395
- | 'AUTOMATIONS_MANAGE'
2396
- /** Uniform Canvas:Workflows:Manage|Create, update, and delete workflow definitions. */
2397
- | 'WORKFLOWS_MANAGE'
2398
2388
  /** UTM Mapper:Read|Read UTM mapper configuration */
2399
2389
  | 'UTM_MAPPER_READ'
2400
2390
  /** UTM Mapper:Read|Create, update and delete UTM mapper configuration */
package/dist/index.esm.js CHANGED
@@ -163,7 +163,7 @@ var getLogger = (prefix, debug) => {
163
163
  };
164
164
 
165
165
  // src/temp/version.ts
166
- var UNIFORM_MESH_SDK_VERSION = "20.71.0";
166
+ var UNIFORM_MESH_SDK_VERSION = "20.71.1";
167
167
 
168
168
  // src/framepost/constants.ts
169
169
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
package/dist/index.js CHANGED
@@ -207,7 +207,7 @@ var getLogger = (prefix, debug) => {
207
207
  };
208
208
 
209
209
  // src/temp/version.ts
210
- var UNIFORM_MESH_SDK_VERSION = "20.71.0";
210
+ var UNIFORM_MESH_SDK_VERSION = "20.71.1";
211
211
 
212
212
  // src/framepost/constants.ts
213
213
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
package/dist/index.mjs CHANGED
@@ -163,7 +163,7 @@ var getLogger = (prefix, debug) => {
163
163
  };
164
164
 
165
165
  // src/temp/version.ts
166
- var UNIFORM_MESH_SDK_VERSION = "20.71.0";
166
+ var UNIFORM_MESH_SDK_VERSION = "20.71.1";
167
167
 
168
168
  // src/framepost/constants.ts
169
169
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -1,3 +1,5 @@
1
+ import { ApiClient } from '@uniformdev/context/api';
2
+
1
3
  /** @deprecated This beta identity delegation API may change with breaking changes. */
2
4
  interface DelegationTokenClientOptions {
3
5
  /** Uniform API host (e.g. 'https://uniform.app'). */
@@ -6,6 +8,8 @@ interface DelegationTokenClientOptions {
6
8
  integrationId: string;
7
9
  /** Plaintext app secret for this integration. */
8
10
  integrationSecret: string;
11
+ /** Optional fetch implementation. Defaults to global fetch. */
12
+ fetch?: typeof fetch;
9
13
  }
10
14
  /** @deprecated This beta identity delegation API may change with breaking changes. */
11
15
  interface DelegationTokenResponse {
@@ -48,9 +52,13 @@ declare function buildDelegationTokenError(status: number): DelegationTokenError
48
52
  * Use this in your integration's backend to exchange a session token (obtained from the
49
53
  * Mesh SDK iframe context) for a delegation token, or to refresh an existing delegation token.
50
54
  *
55
+ * Extends {@link ApiClient} to inherit concurrency limiting (limitPolicy) and 429 retry
56
+ * with exponential backoff (handleRateLimits). Auth credentials go in the POST body —
57
+ * the inherited header-based auth is intentionally unused.
58
+ *
51
59
  * @deprecated This beta identity delegation API may change with breaking changes.
52
60
  */
53
- declare class DelegationTokenClient {
61
+ declare class DelegationTokenClient extends ApiClient {
54
62
  #private;
55
63
  constructor(options: DelegationTokenClientOptions);
56
64
  /**
@@ -8,6 +8,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
8
8
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
9
9
 
10
10
  // src/server/clients/DelegationTokenClient.ts
11
+ import { ApiClient } from "@uniformdev/context/api";
11
12
  var DelegationTokenError = class extends Error {
12
13
  constructor(status, kind, publicMessage) {
13
14
  super(publicMessage);
@@ -50,12 +51,20 @@ function buildDelegationTokenError(status) {
50
51
  const kind = classifyDelegationTokenStatus(status);
51
52
  return new DelegationTokenError(status, kind, PUBLIC_MESSAGES[kind]);
52
53
  }
53
- var _options, _DelegationTokenClient_instances, post_fn;
54
- var DelegationTokenClient = class {
54
+ var _integrationId, _integrationSecret, _explicitFetch, _DelegationTokenClient_instances, post_fn;
55
+ var DelegationTokenClient = class extends ApiClient {
55
56
  constructor(options) {
57
+ super({ apiHost: options.apiHost, apiKey: "avoid_constructor_check", fetch: options.fetch });
56
58
  __privateAdd(this, _DelegationTokenClient_instances);
57
- __privateAdd(this, _options);
58
- __privateSet(this, _options, options);
59
+ __privateAdd(this, _integrationId);
60
+ __privateAdd(this, _integrationSecret);
61
+ // Preserve the caller-supplied fetch so #post can fall back to the global fetch at
62
+ // call time when none was provided. ApiClient captures the global at construction,
63
+ // which breaks test-time global stubbing (vi.stubGlobal).
64
+ __privateAdd(this, _explicitFetch);
65
+ __privateSet(this, _integrationId, options.integrationId);
66
+ __privateSet(this, _integrationSecret, options.integrationSecret);
67
+ __privateSet(this, _explicitFetch, options.fetch);
59
68
  }
60
69
  /**
61
70
  * Exchanges a short-lived session token for a delegation token and refresh token.
@@ -67,8 +76,8 @@ var DelegationTokenClient = class {
67
76
  return __privateMethod(this, _DelegationTokenClient_instances, post_fn).call(this, {
68
77
  grantType: "delegation_token",
69
78
  sessionToken,
70
- integrationId: __privateGet(this, _options).integrationId,
71
- integrationSecret: __privateGet(this, _options).integrationSecret
79
+ integrationId: __privateGet(this, _integrationId),
80
+ integrationSecret: __privateGet(this, _integrationSecret)
72
81
  });
73
82
  }
74
83
  /**
@@ -86,20 +95,26 @@ var DelegationTokenClient = class {
86
95
  return __privateMethod(this, _DelegationTokenClient_instances, post_fn).call(this, {
87
96
  grantType: "refresh_token",
88
97
  refreshToken,
89
- integrationId: __privateGet(this, _options).integrationId,
90
- integrationSecret: __privateGet(this, _options).integrationSecret
98
+ integrationId: __privateGet(this, _integrationId),
99
+ integrationSecret: __privateGet(this, _integrationSecret)
91
100
  });
92
101
  }
93
102
  };
94
- _options = new WeakMap();
103
+ _integrationId = new WeakMap();
104
+ _integrationSecret = new WeakMap();
105
+ _explicitFetch = new WeakMap();
95
106
  _DelegationTokenClient_instances = new WeakSet();
96
107
  post_fn = async function(body) {
97
- const url = `${__privateGet(this, _options).apiHost}/api/v1/token`;
98
- const response = await fetch(url, {
99
- method: "POST",
100
- headers: { "Content-Type": "application/json" },
101
- body: JSON.stringify(body)
102
- });
108
+ var _a;
109
+ const url = this.createUrl("/api/v1/token");
110
+ const fetchFn = (_a = __privateGet(this, _explicitFetch)) != null ? _a : fetch;
111
+ const response = await this.options.limitPolicy(
112
+ () => fetchFn(url.toString(), {
113
+ method: "POST",
114
+ headers: { "Content-Type": "application/json" },
115
+ body: JSON.stringify(body)
116
+ })
117
+ );
103
118
  if (!response.ok) {
104
119
  await response.text().catch(() => "");
105
120
  throw buildDelegationTokenError(response.status);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "20.50.2-alpha.167+74e60d5bb7",
3
+ "version": "20.50.2-alpha.180+0be2307590",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -51,10 +51,10 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@uniformdev/assets": "20.50.2-alpha.167+74e60d5bb7",
55
- "@uniformdev/canvas": "20.50.2-alpha.167+74e60d5bb7",
56
- "@uniformdev/context": "20.50.2-alpha.167+74e60d5bb7",
57
- "@uniformdev/project-map": "20.50.2-alpha.167+74e60d5bb7",
54
+ "@uniformdev/assets": "20.50.2-alpha.180+0be2307590",
55
+ "@uniformdev/canvas": "20.50.2-alpha.180+0be2307590",
56
+ "@uniformdev/context": "20.50.2-alpha.180+0be2307590",
57
+ "@uniformdev/project-map": "20.50.2-alpha.180+0be2307590",
58
58
  "cookie": "^1.1.1",
59
59
  "imagesloaded": "^5.0.0",
60
60
  "jose": "^6.2.2",
@@ -65,5 +65,5 @@
65
65
  "openai": "6.44.0",
66
66
  "tsup": "8.5.1"
67
67
  },
68
- "gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
68
+ "gitHead": "0be23075901a6fd0acd8166a2bea65fbd5589789"
69
69
  }