@uniformdev/canvas 19.61.1-alpha.13 → 19.61.1-alpha.23
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 +485 -1057
- package/dist/index.d.ts +485 -1057
- package/dist/index.esm.js +9 -14
- package/dist/index.js +9 -14
- package/dist/index.mjs +9 -14
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
@@ -717,12 +717,13 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
|
|
717
717
|
});
|
718
718
|
return this.apiClient(historyUrl);
|
719
719
|
}
|
720
|
-
async upsertContentType(body) {
|
720
|
+
async upsertContentType(body, opts = {}) {
|
721
721
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
722
722
|
await this.apiClient(fetchUri, {
|
723
723
|
method: "PUT",
|
724
724
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
725
|
-
expectNoContent: true
|
725
|
+
expectNoContent: true,
|
726
|
+
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
726
727
|
});
|
727
728
|
}
|
728
729
|
async upsertEntry(body) {
|
@@ -1826,7 +1827,7 @@ var createCanvasChannel = ({
|
|
1826
1827
|
};
|
1827
1828
|
postMessage(message);
|
1828
1829
|
};
|
1829
|
-
const ready = () => {
|
1830
|
+
const ready = (options) => {
|
1830
1831
|
var _a, _b;
|
1831
1832
|
if (typeof window === "undefined") {
|
1832
1833
|
return;
|
@@ -1836,7 +1837,8 @@ var createCanvasChannel = ({
|
|
1836
1837
|
const message = {
|
1837
1838
|
type: "ready",
|
1838
1839
|
framework,
|
1839
|
-
version
|
1840
|
+
version,
|
1841
|
+
rsc: options == null ? void 0 : options.rsc
|
1840
1842
|
};
|
1841
1843
|
postMessage(message);
|
1842
1844
|
};
|
@@ -2096,27 +2098,20 @@ function subscribeToComposition({
|
|
2096
2098
|
|
2097
2099
|
// src/PromptClient.ts
|
2098
2100
|
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2099
|
-
var PromptUrl = "/api/v1/prompt";
|
2100
2101
|
var PromptsUrl = "/api/v1/prompts";
|
2101
2102
|
var PromptClient = class extends ApiClient7 {
|
2102
2103
|
constructor(options) {
|
2103
2104
|
super(options);
|
2104
2105
|
}
|
2105
|
-
/** Fetches
|
2106
|
+
/** Fetches Prompts for a project */
|
2106
2107
|
async get(options) {
|
2107
|
-
const { projectId } = this.options;
|
2108
|
-
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2109
|
-
return await this.apiClient(fetchUri);
|
2110
|
-
}
|
2111
|
-
/** Fetches all Prompts for a project */
|
2112
|
-
async getList(options) {
|
2113
2108
|
const { projectId } = this.options;
|
2114
2109
|
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2115
2110
|
return await this.apiClient(fetchUri);
|
2116
2111
|
}
|
2117
2112
|
/** Updates or creates (based on id) a Prompt */
|
2118
2113
|
async upsert(body) {
|
2119
|
-
const fetchUri = this.createUrl(
|
2114
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2120
2115
|
await this.apiClient(fetchUri, {
|
2121
2116
|
method: "PUT",
|
2122
2117
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2125,7 +2120,7 @@ var PromptClient = class extends ApiClient7 {
|
|
2125
2120
|
}
|
2126
2121
|
/** Deletes a Prompt */
|
2127
2122
|
async remove(body) {
|
2128
|
-
const fetchUri = this.createUrl(
|
2123
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2129
2124
|
await this.apiClient(fetchUri, {
|
2130
2125
|
method: "DELETE",
|
2131
2126
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
package/dist/index.js
CHANGED
@@ -829,12 +829,13 @@ var _ContentClient = class _ContentClient extends import_api5.ApiClient {
|
|
829
829
|
});
|
830
830
|
return this.apiClient(historyUrl);
|
831
831
|
}
|
832
|
-
async upsertContentType(body) {
|
832
|
+
async upsertContentType(body, opts = {}) {
|
833
833
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
834
834
|
await this.apiClient(fetchUri, {
|
835
835
|
method: "PUT",
|
836
836
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
837
|
-
expectNoContent: true
|
837
|
+
expectNoContent: true,
|
838
|
+
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
838
839
|
});
|
839
840
|
}
|
840
841
|
async upsertEntry(body) {
|
@@ -1938,7 +1939,7 @@ var createCanvasChannel = ({
|
|
1938
1939
|
};
|
1939
1940
|
postMessage(message);
|
1940
1941
|
};
|
1941
|
-
const ready = () => {
|
1942
|
+
const ready = (options) => {
|
1942
1943
|
var _a, _b;
|
1943
1944
|
if (typeof window === "undefined") {
|
1944
1945
|
return;
|
@@ -1948,7 +1949,8 @@ var createCanvasChannel = ({
|
|
1948
1949
|
const message = {
|
1949
1950
|
type: "ready",
|
1950
1951
|
framework,
|
1951
|
-
version
|
1952
|
+
version,
|
1953
|
+
rsc: options == null ? void 0 : options.rsc
|
1952
1954
|
};
|
1953
1955
|
postMessage(message);
|
1954
1956
|
};
|
@@ -2208,27 +2210,20 @@ function subscribeToComposition({
|
|
2208
2210
|
|
2209
2211
|
// src/PromptClient.ts
|
2210
2212
|
var import_api8 = require("@uniformdev/context/api");
|
2211
|
-
var PromptUrl = "/api/v1/prompt";
|
2212
2213
|
var PromptsUrl = "/api/v1/prompts";
|
2213
2214
|
var PromptClient = class extends import_api8.ApiClient {
|
2214
2215
|
constructor(options) {
|
2215
2216
|
super(options);
|
2216
2217
|
}
|
2217
|
-
/** Fetches
|
2218
|
+
/** Fetches Prompts for a project */
|
2218
2219
|
async get(options) {
|
2219
|
-
const { projectId } = this.options;
|
2220
|
-
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2221
|
-
return await this.apiClient(fetchUri);
|
2222
|
-
}
|
2223
|
-
/** Fetches all Prompts for a project */
|
2224
|
-
async getList(options) {
|
2225
2220
|
const { projectId } = this.options;
|
2226
2221
|
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2227
2222
|
return await this.apiClient(fetchUri);
|
2228
2223
|
}
|
2229
2224
|
/** Updates or creates (based on id) a Prompt */
|
2230
2225
|
async upsert(body) {
|
2231
|
-
const fetchUri = this.createUrl(
|
2226
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2232
2227
|
await this.apiClient(fetchUri, {
|
2233
2228
|
method: "PUT",
|
2234
2229
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2237,7 +2232,7 @@ var PromptClient = class extends import_api8.ApiClient {
|
|
2237
2232
|
}
|
2238
2233
|
/** Deletes a Prompt */
|
2239
2234
|
async remove(body) {
|
2240
|
-
const fetchUri = this.createUrl(
|
2235
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2241
2236
|
await this.apiClient(fetchUri, {
|
2242
2237
|
method: "DELETE",
|
2243
2238
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
package/dist/index.mjs
CHANGED
@@ -717,12 +717,13 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
|
|
717
717
|
});
|
718
718
|
return this.apiClient(historyUrl);
|
719
719
|
}
|
720
|
-
async upsertContentType(body) {
|
720
|
+
async upsertContentType(body, opts = {}) {
|
721
721
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
722
722
|
await this.apiClient(fetchUri, {
|
723
723
|
method: "PUT",
|
724
724
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
725
|
-
expectNoContent: true
|
725
|
+
expectNoContent: true,
|
726
|
+
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
726
727
|
});
|
727
728
|
}
|
728
729
|
async upsertEntry(body) {
|
@@ -1826,7 +1827,7 @@ var createCanvasChannel = ({
|
|
1826
1827
|
};
|
1827
1828
|
postMessage(message);
|
1828
1829
|
};
|
1829
|
-
const ready = () => {
|
1830
|
+
const ready = (options) => {
|
1830
1831
|
var _a, _b;
|
1831
1832
|
if (typeof window === "undefined") {
|
1832
1833
|
return;
|
@@ -1836,7 +1837,8 @@ var createCanvasChannel = ({
|
|
1836
1837
|
const message = {
|
1837
1838
|
type: "ready",
|
1838
1839
|
framework,
|
1839
|
-
version
|
1840
|
+
version,
|
1841
|
+
rsc: options == null ? void 0 : options.rsc
|
1840
1842
|
};
|
1841
1843
|
postMessage(message);
|
1842
1844
|
};
|
@@ -2096,27 +2098,20 @@ function subscribeToComposition({
|
|
2096
2098
|
|
2097
2099
|
// src/PromptClient.ts
|
2098
2100
|
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2099
|
-
var PromptUrl = "/api/v1/prompt";
|
2100
2101
|
var PromptsUrl = "/api/v1/prompts";
|
2101
2102
|
var PromptClient = class extends ApiClient7 {
|
2102
2103
|
constructor(options) {
|
2103
2104
|
super(options);
|
2104
2105
|
}
|
2105
|
-
/** Fetches
|
2106
|
+
/** Fetches Prompts for a project */
|
2106
2107
|
async get(options) {
|
2107
|
-
const { projectId } = this.options;
|
2108
|
-
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2109
|
-
return await this.apiClient(fetchUri);
|
2110
|
-
}
|
2111
|
-
/** Fetches all Prompts for a project */
|
2112
|
-
async getList(options) {
|
2113
2108
|
const { projectId } = this.options;
|
2114
2109
|
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2115
2110
|
return await this.apiClient(fetchUri);
|
2116
2111
|
}
|
2117
2112
|
/** Updates or creates (based on id) a Prompt */
|
2118
2113
|
async upsert(body) {
|
2119
|
-
const fetchUri = this.createUrl(
|
2114
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2120
2115
|
await this.apiClient(fetchUri, {
|
2121
2116
|
method: "PUT",
|
2122
2117
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2125,7 +2120,7 @@ var PromptClient = class extends ApiClient7 {
|
|
2125
2120
|
}
|
2126
2121
|
/** Deletes a Prompt */
|
2127
2122
|
async remove(body) {
|
2128
|
-
const fetchUri = this.createUrl(
|
2123
|
+
const fetchUri = this.createUrl(PromptsUrl);
|
2129
2124
|
await this.apiClient(fetchUri, {
|
2130
2125
|
method: "DELETE",
|
2131
2126
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.61.1-alpha.
|
3
|
+
"version": "19.61.1-alpha.23+f3b91f17a",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "19.61.1-alpha.
|
42
|
-
"@uniformdev/context": "19.61.1-alpha.
|
41
|
+
"@uniformdev/assets": "19.61.1-alpha.23+f3b91f17a",
|
42
|
+
"@uniformdev/context": "19.61.1-alpha.23+f3b91f17a",
|
43
43
|
"immer": "9.0.21"
|
44
44
|
},
|
45
45
|
"files": [
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"publishConfig": {
|
49
49
|
"access": "public"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "f3b91f17a3a9f28f817e68e91ace4b414e9befe4"
|
52
52
|
}
|