@gravity-rail/sdk 0.46.0 → 0.47.0
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/README.md +2 -0
- package/dist/{chat-interaction-0MSzmdxz.d.cts → chat-interaction-Bqj3Vbst.d.cts} +32 -12
- package/dist/{chat-interaction-CO9ecTSn.d.ts → chat-interaction-DiZVtDRE.d.ts} +32 -12
- package/dist/{chunk-I7BMDNPO.js → chunk-N4GQWNGU.js} +46 -1
- package/dist/chunk-N4GQWNGU.js.map +1 -0
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/index.cjs +45 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +45 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +1 -1
- package/dist/{revision-state-Cc3-CIi5.d.ts → revision-state-DaVz2528.d.ts} +1 -1
- package/dist/{revision-state-m6Cjyr4M.d.cts → revision-state-ZC4qP3CS.d.cts} +1 -1
- package/dist/schemas.cjs +2 -0
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +15 -0
- package/dist/schemas.d.ts +15 -0
- package/dist/schemas.js +2 -0
- package/dist/schemas.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-I7BMDNPO.js.map +0 -1
package/dist/helpers.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g7 as GravityRailClient } from './chat-interaction-
|
|
2
|
-
export { ce as ChatInteractionController } from './chat-interaction-
|
|
1
|
+
import { g7 as GravityRailClient } from './chat-interaction-Bqj3Vbst.cjs';
|
|
2
|
+
export { ce as ChatInteractionController } from './chat-interaction-Bqj3Vbst.cjs';
|
|
3
3
|
import { c7 as WorkspaceMemberResponse, aT as DataRecordResponse } from './tasks-Ca6yfsj2.cjs';
|
|
4
4
|
export { t as toSafeMemberImportPreview, a as toSafeMemberImportSummary } from './member-import-D7U4kDIy.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g7 as GravityRailClient } from './chat-interaction-
|
|
2
|
-
export { ce as ChatInteractionController } from './chat-interaction-
|
|
1
|
+
import { g7 as GravityRailClient } from './chat-interaction-DiZVtDRE.js';
|
|
2
|
+
export { ce as ChatInteractionController } from './chat-interaction-DiZVtDRE.js';
|
|
3
3
|
import { c7 as WorkspaceMemberResponse, aT as DataRecordResponse } from './tasks-Ca6yfsj2.js';
|
|
4
4
|
export { t as toSafeMemberImportPreview, a as toSafeMemberImportSummary } from './member-import-C2Xt_o5d.js';
|
|
5
5
|
import 'zod';
|
package/dist/index.cjs
CHANGED
|
@@ -3139,6 +3139,45 @@ var DashboardsApi = class extends BaseApiClient {
|
|
|
3139
3139
|
|
|
3140
3140
|
// src/api/data-types.ts
|
|
3141
3141
|
var DataTypesApi = class extends BaseApiClient {
|
|
3142
|
+
/** Read an anonymous Form's visitor-writable schema without a Member session. */
|
|
3143
|
+
async getAnonymousFormSchema(wid, formUuid) {
|
|
3144
|
+
return this.fetchPublicAnonymousForm(
|
|
3145
|
+
`w/${encodeURIComponent(wid)}/anonymous-forms/${encodeURIComponent(formUuid)}`
|
|
3146
|
+
);
|
|
3147
|
+
}
|
|
3148
|
+
/** Submit visitor-provided values. No cookie or API credential is sent. */
|
|
3149
|
+
async submitAnonymousForm(wid, formUuid, input) {
|
|
3150
|
+
return this.fetchPublicAnonymousForm(
|
|
3151
|
+
`w/${encodeURIComponent(wid)}/anonymous-forms/${encodeURIComponent(formUuid)}/submissions`,
|
|
3152
|
+
{ method: "POST", body: JSON.stringify(input) }
|
|
3153
|
+
);
|
|
3154
|
+
}
|
|
3155
|
+
async fetchPublicAnonymousForm(endpoint, options = {}) {
|
|
3156
|
+
const headers = new Headers(options.headers);
|
|
3157
|
+
if (options.body !== void 0) headers.set("Content-Type", "application/json");
|
|
3158
|
+
let response;
|
|
3159
|
+
try {
|
|
3160
|
+
response = await this.fetchFunction(`${this.baseUrl}/api/v2/${endpoint}`, {
|
|
3161
|
+
...options,
|
|
3162
|
+
credentials: "omit",
|
|
3163
|
+
headers
|
|
3164
|
+
});
|
|
3165
|
+
} catch {
|
|
3166
|
+
throw new ApiError("Anonymous Form request failed", 0);
|
|
3167
|
+
}
|
|
3168
|
+
if (!response.ok) {
|
|
3169
|
+
let message = `Request failed with status ${response.status}`;
|
|
3170
|
+
try {
|
|
3171
|
+
const body = await response.json();
|
|
3172
|
+
if (typeof body.detail === "string" && body.detail.length > 0) {
|
|
3173
|
+
message = body.detail;
|
|
3174
|
+
}
|
|
3175
|
+
} catch {
|
|
3176
|
+
}
|
|
3177
|
+
throw new ApiError(message, response.status);
|
|
3178
|
+
}
|
|
3179
|
+
return await response.json();
|
|
3180
|
+
}
|
|
3142
3181
|
/** Read the local Form's draft and optimistic publication counters. */
|
|
3143
3182
|
async getDataTypeDraft(wid, id) {
|
|
3144
3183
|
return this.fetch(`w/${wid}/data-types/${id}/schema-draft`);
|
|
@@ -12834,6 +12873,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
12834
12873
|
"getAgents",
|
|
12835
12874
|
"getAnonymousResolution",
|
|
12836
12875
|
"getAnonymousFormSubmission",
|
|
12876
|
+
"getAnonymousFormSchema",
|
|
12837
12877
|
"getAnonymousResolutions",
|
|
12838
12878
|
"getApiKeys",
|
|
12839
12879
|
"getArchiveBlockers",
|
|
@@ -13219,6 +13259,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
13219
13259
|
"linkUnlinkedSalesforceMembersByIdentity",
|
|
13220
13260
|
"listAbilities",
|
|
13221
13261
|
"listAnonymousFormSubmissions",
|
|
13262
|
+
"submitAnonymousForm",
|
|
13222
13263
|
"listAppConnections",
|
|
13223
13264
|
"listAvailableAppConnections",
|
|
13224
13265
|
"listInstallations",
|
|
@@ -13672,6 +13713,8 @@ function bindTrackedLinksMethods(target, trackedLinks) {
|
|
|
13672
13713
|
|
|
13673
13714
|
// src/client/bindings/data-types.ts
|
|
13674
13715
|
function bindDataTypesMethods(target, dataTypes) {
|
|
13716
|
+
target.getAnonymousFormSchema = dataTypes.getAnonymousFormSchema.bind(dataTypes);
|
|
13717
|
+
target.submitAnonymousForm = dataTypes.submitAnonymousForm.bind(dataTypes);
|
|
13675
13718
|
target.getDataTypeDraft = dataTypes.getDataTypeDraft.bind(dataTypes);
|
|
13676
13719
|
target.saveDataTypeDraft = dataTypes.saveDataTypeDraft.bind(dataTypes);
|
|
13677
13720
|
target.publishDataTypeDraft = dataTypes.publishDataTypeDraft.bind(dataTypes);
|
|
@@ -14866,6 +14909,8 @@ var GravityRailClient = class {
|
|
|
14866
14909
|
getCelContext;
|
|
14867
14910
|
validateCelExpression;
|
|
14868
14911
|
// Data Types API
|
|
14912
|
+
getAnonymousFormSchema;
|
|
14913
|
+
submitAnonymousForm;
|
|
14869
14914
|
getDataTypes;
|
|
14870
14915
|
getDataTypeDraft;
|
|
14871
14916
|
saveDataTypeDraft;
|