@uniformdev/context 14.2.1-alpha.177 → 14.2.1-alpha.256

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "14.2.1-alpha.177+e3102741f",
3
+ "version": "14.2.1-alpha.256+3b08eaee2",
4
4
  "description": "Uniform Context core package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/js-cookie": "3.0.1",
53
- "@types/yargs": "17.0.9",
54
- "@uniformdev/cli": "^14.2.1-alpha.177+e3102741f",
53
+ "@types/yargs": "17.0.10",
54
+ "@uniformdev/cli": "^14.2.1-alpha.256+3b08eaee2",
55
55
  "benny": "3.7.1",
56
- "yargs": "17.3.1"
56
+ "yargs": "17.4.0"
57
57
  },
58
58
  "dependencies": {
59
59
  "dequal": "^2.0.2",
@@ -66,5 +66,5 @@
66
66
  "files": [
67
67
  "/dist"
68
68
  ],
69
- "gitHead": "e3102741f79fa495dba2796f59e3b2a6734c3c7e"
69
+ "gitHead": "3b08eaee27018fbfe1ac4b2bc7e1d6cefb4b9bdf"
70
70
  }
@@ -1,76 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined")
13
- return require.apply(this, arguments);
14
- throw new Error('Dynamic require of "' + x + '" is not supported');
15
- });
16
- var __esm = (fn, res) => function __init() {
17
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
- };
19
- var __commonJS = (cb, mod) => function __require2() {
20
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
- };
22
- var __reExport = (target, module, copyDefault, desc) => {
23
- if (module && typeof module === "object" || typeof module === "function") {
24
- for (let key of __getOwnPropNames(module))
25
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
26
- __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
27
- }
28
- return target;
29
- };
30
- var __toESM = (module, isNodeMode) => {
31
- return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", !isNodeMode && module && module.__esModule ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
32
- };
33
- var __publicField = (obj, key, value) => {
34
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
- return value;
36
- };
37
- var __accessCheck = (obj, member, msg) => {
38
- if (!member.has(obj))
39
- throw TypeError("Cannot " + msg);
40
- };
41
- var __privateGet = (obj, member, getter) => {
42
- __accessCheck(obj, member, "read from private field");
43
- return getter ? getter.call(obj) : member.get(obj);
44
- };
45
- var __privateAdd = (obj, member, value) => {
46
- if (member.has(obj))
47
- throw TypeError("Cannot add the same private member more than once");
48
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
49
- };
50
- var __privateSet = (obj, member, value, setter) => {
51
- __accessCheck(obj, member, "write to private field");
52
- setter ? setter.call(obj, value) : member.set(obj, value);
53
- return value;
54
- };
55
- var __privateMethod = (obj, member, method) => {
56
- __accessCheck(obj, member, "access private method");
57
- return method;
58
- };
59
-
60
- // ../../node_modules/.pnpm/tsup@5.12.1_typescript@4.6.2/node_modules/tsup/assets/esm_shims.js
61
- var init_esm_shims = __esm({
62
- "../../node_modules/.pnpm/tsup@5.12.1_typescript@4.6.2/node_modules/tsup/assets/esm_shims.js"() {
63
- }
64
- });
65
-
66
- export {
67
- __require,
68
- __commonJS,
69
- __toESM,
70
- __publicField,
71
- __privateGet,
72
- __privateAdd,
73
- __privateSet,
74
- __privateMethod,
75
- init_esm_shims
76
- };
@@ -1,307 +0,0 @@
1
- import {
2
- __privateAdd,
3
- __privateGet,
4
- __publicField,
5
- init_esm_shims
6
- } from "./chunk-A5FZYSIL.mjs";
7
-
8
- // src/api/apiClientUtils.ts
9
- init_esm_shims();
10
- var nullLimitPolicy = async (func) => await func();
11
- var ApiClientError = class extends Error {
12
- constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText) {
13
- super(`${errorMessage}
14
- ${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri})`);
15
- this.errorMessage = errorMessage;
16
- this.fetchMethod = fetchMethod;
17
- this.fetchUri = fetchUri;
18
- this.statusCode = statusCode;
19
- this.statusText = statusText;
20
- Object.setPrototypeOf(this, ApiClientError.prototype);
21
- }
22
- };
23
-
24
- // src/api/AggregateClient.ts
25
- init_esm_shims();
26
-
27
- // src/api/ApiClient.ts
28
- init_esm_shims();
29
- var ApiClient = class {
30
- constructor(options) {
31
- __publicField(this, "options");
32
- var _a, _b, _c, _d, _e, _f;
33
- if (!options.apiKey && !options.bearerToken) {
34
- throw new Error("You must provide an API key or a bearer token");
35
- }
36
- this.options = {
37
- ...options,
38
- fetch: (_a = options.fetch) != null ? _a : fetch,
39
- apiHost: (_b = options.apiHost) != null ? _b : "https://uniform.app",
40
- apiKey: (_c = options.apiKey) != null ? _c : null,
41
- projectId: (_d = options.projectId) != null ? _d : null,
42
- bearerToken: (_e = options.bearerToken) != null ? _e : null,
43
- limitPolicy: (_f = options.limitPolicy) != null ? _f : nullLimitPolicy
44
- };
45
- }
46
- async apiClient(fetchUri, options) {
47
- return this.options.limitPolicy(async () => {
48
- var _a;
49
- const authHeaders = this.options.apiKey ? {
50
- "x-api-key": this.options.apiKey
51
- } : {
52
- Authorization: `Bearer ${this.options.bearerToken}`
53
- };
54
- const apiResponse = await fetch(fetchUri.toString(), {
55
- ...options,
56
- headers: {
57
- ...options == null ? void 0 : options.headers,
58
- ...authHeaders
59
- }
60
- });
61
- if (!apiResponse.ok) {
62
- let message = "";
63
- try {
64
- const responseText = await apiResponse.text();
65
- try {
66
- const parsed = JSON.parse(responseText);
67
- if (parsed.errorMessage) {
68
- message = Array.isArray(parsed.errorMessage) ? parsed.errorMessage.join(", ") : parsed.errorMessage;
69
- } else {
70
- message = responseText;
71
- }
72
- } catch (e) {
73
- message = responseText;
74
- }
75
- } catch (e) {
76
- message = `General error`;
77
- }
78
- throw new ApiClientError(message, (_a = options == null ? void 0 : options.method) != null ? _a : "GET", fetchUri.toString(), apiResponse.status);
79
- }
80
- if (options == null ? void 0 : options.expectNoContent) {
81
- return null;
82
- }
83
- return await apiResponse.json();
84
- });
85
- }
86
- createUrl(path, queryParams) {
87
- const url = new URL(`${this.options.apiHost}${path}`);
88
- Object.entries(queryParams != null ? queryParams : {}).forEach(([key, value]) => {
89
- var _a;
90
- if (typeof value !== "undefined" && value !== null) {
91
- url.searchParams.append(key, (_a = value == null ? void 0 : value.toString()) != null ? _a : "");
92
- }
93
- });
94
- return url;
95
- }
96
- };
97
-
98
- // src/api/AggregateClient.ts
99
- var _url;
100
- var _AggregateClient = class extends ApiClient {
101
- constructor(options) {
102
- super(options);
103
- }
104
- async get(options) {
105
- const { projectId } = this.options;
106
- const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url), { ...options, projectId });
107
- return await this.apiClient(fetchUri);
108
- }
109
- async upsert(body) {
110
- const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
111
- await this.apiClient(fetchUri, {
112
- method: "PUT",
113
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
114
- expectNoContent: true
115
- });
116
- }
117
- async remove(body) {
118
- const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
119
- await this.apiClient(fetchUri, {
120
- method: "DELETE",
121
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
122
- expectNoContent: true
123
- });
124
- }
125
- };
126
- var AggregateClient = _AggregateClient;
127
- _url = new WeakMap();
128
- __privateAdd(AggregateClient, _url, "/api/v2/aggregate");
129
-
130
- // src/api/EnrichmentClient.ts
131
- init_esm_shims();
132
- var _url2, _valueUrl;
133
- var _EnrichmentClient = class extends ApiClient {
134
- constructor(options) {
135
- super(options);
136
- }
137
- async get(options) {
138
- const { projectId } = this.options;
139
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url2), { ...options, projectId });
140
- return await this.apiClient(fetchUri);
141
- }
142
- async upsertCategory(body) {
143
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url2));
144
- await this.apiClient(fetchUri, {
145
- method: "PUT",
146
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
147
- expectNoContent: true
148
- });
149
- }
150
- async removeCategory(body) {
151
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url2));
152
- await this.apiClient(fetchUri, {
153
- method: "DELETE",
154
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
155
- expectNoContent: true
156
- });
157
- }
158
- async upsertValue(body) {
159
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
160
- await this.apiClient(fetchUri, {
161
- method: "PUT",
162
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
163
- expectNoContent: true
164
- });
165
- }
166
- async removeValue(body) {
167
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
168
- await this.apiClient(fetchUri, {
169
- method: "DELETE",
170
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
171
- expectNoContent: true
172
- });
173
- }
174
- };
175
- var EnrichmentClient = _EnrichmentClient;
176
- _url2 = new WeakMap();
177
- _valueUrl = new WeakMap();
178
- __privateAdd(EnrichmentClient, _url2, "/api/v1/enrichments");
179
- __privateAdd(EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
180
-
181
- // src/api/ManifestClient.ts
182
- init_esm_shims();
183
- var _url3;
184
- var _ManifestClient = class extends ApiClient {
185
- constructor(options) {
186
- super(options);
187
- }
188
- async get(options) {
189
- const { projectId } = this.options;
190
- const fetchUri = this.createUrl(__privateGet(_ManifestClient, _url3), { ...options, projectId });
191
- return await this.apiClient(fetchUri);
192
- }
193
- };
194
- var ManifestClient = _ManifestClient;
195
- _url3 = new WeakMap();
196
- __privateAdd(ManifestClient, _url3, "/api/v2/manifest");
197
-
198
- // src/api/QuirkClient.ts
199
- init_esm_shims();
200
- var _url4;
201
- var _QuirkClient = class extends ApiClient {
202
- constructor(options) {
203
- super(options);
204
- }
205
- async get(options) {
206
- const { projectId } = this.options;
207
- const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url4), { ...options, projectId });
208
- return await this.apiClient(fetchUri);
209
- }
210
- async upsert(body) {
211
- const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url4));
212
- await this.apiClient(fetchUri, {
213
- method: "PUT",
214
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
215
- expectNoContent: true
216
- });
217
- }
218
- async remove(body) {
219
- const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url4));
220
- await this.apiClient(fetchUri, {
221
- method: "DELETE",
222
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
223
- expectNoContent: true
224
- });
225
- }
226
- };
227
- var QuirkClient = _QuirkClient;
228
- _url4 = new WeakMap();
229
- __privateAdd(QuirkClient, _url4, "/api/v2/quirk");
230
-
231
- // src/api/SignalClient.ts
232
- init_esm_shims();
233
- var _url5;
234
- var _SignalClient = class extends ApiClient {
235
- constructor(options) {
236
- super(options);
237
- }
238
- async get(options) {
239
- const { projectId } = this.options;
240
- const fetchUri = this.createUrl(__privateGet(_SignalClient, _url5), { ...options, projectId });
241
- return await this.apiClient(fetchUri);
242
- }
243
- async upsert(body) {
244
- const fetchUri = this.createUrl(__privateGet(_SignalClient, _url5));
245
- await this.apiClient(fetchUri, {
246
- method: "PUT",
247
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
248
- expectNoContent: true
249
- });
250
- }
251
- async remove(body) {
252
- const fetchUri = this.createUrl(__privateGet(_SignalClient, _url5));
253
- await this.apiClient(fetchUri, {
254
- method: "DELETE",
255
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
256
- expectNoContent: true
257
- });
258
- }
259
- };
260
- var SignalClient = _SignalClient;
261
- _url5 = new WeakMap();
262
- __privateAdd(SignalClient, _url5, "/api/v2/signal");
263
-
264
- // src/api/TestClient.ts
265
- init_esm_shims();
266
- var _url6;
267
- var _TestClient = class extends ApiClient {
268
- constructor(options) {
269
- super(options);
270
- }
271
- async get(options) {
272
- const { projectId } = this.options;
273
- const fetchUri = this.createUrl(__privateGet(_TestClient, _url6), { ...options, projectId });
274
- return await this.apiClient(fetchUri);
275
- }
276
- async upsert(body) {
277
- const fetchUri = this.createUrl(__privateGet(_TestClient, _url6));
278
- await this.apiClient(fetchUri, {
279
- method: "PUT",
280
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
281
- expectNoContent: true
282
- });
283
- }
284
- async remove(body) {
285
- const fetchUri = this.createUrl(__privateGet(_TestClient, _url6));
286
- await this.apiClient(fetchUri, {
287
- method: "DELETE",
288
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
289
- expectNoContent: true
290
- });
291
- }
292
- };
293
- var TestClient = _TestClient;
294
- _url6 = new WeakMap();
295
- __privateAdd(TestClient, _url6, "/api/v2/test");
296
-
297
- export {
298
- nullLimitPolicy,
299
- ApiClientError,
300
- ApiClient,
301
- AggregateClient,
302
- EnrichmentClient,
303
- ManifestClient,
304
- QuirkClient,
305
- SignalClient,
306
- TestClient
307
- };
@@ -1,11 +0,0 @@
1
- import {
2
- init_esm_shims
3
- } from "./chunk-A5FZYSIL.mjs";
4
-
5
- // src/manifest/constants.ts
6
- init_esm_shims();
7
- var ENR_SEPARATOR = "_";
8
-
9
- export {
10
- ENR_SEPARATOR
11
- };