@ram_28/kf-ai-sdk 2.0.2 → 2.0.3
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/BaseField-B6da88U7.js +40 -0
- package/dist/BaseField-Drp0-OxL.cjs +1 -0
- package/dist/api/client.d.ts +7 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.mjs +3 -3
- package/dist/auth.cjs +1 -1
- package/dist/auth.mjs +2 -2
- package/dist/bdo/core/BaseBdo.d.ts +4 -0
- package/dist/bdo/core/BaseBdo.d.ts.map +1 -1
- package/dist/bdo.cjs +1 -1
- package/dist/bdo.mjs +91 -118
- package/dist/client-BULEEaCP.js +222 -0
- package/dist/client-DtPpfJc1.cjs +1 -0
- package/dist/components/hooks/useForm/index.d.ts +1 -1
- package/dist/components/hooks/useForm/index.d.ts.map +1 -1
- package/dist/components/hooks/useForm/types.d.ts +15 -2
- package/dist/components/hooks/useForm/types.d.ts.map +1 -1
- package/dist/components/hooks/useForm/useDraftInteraction.d.ts +26 -0
- package/dist/components/hooks/useForm/useDraftInteraction.d.ts.map +1 -0
- package/dist/components/hooks/useForm/useForm.d.ts +1 -0
- package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
- package/dist/{constants-CM9xOACN.js → constants-BQrBcCON.js} +5 -5
- package/dist/error-handling-CAoD0Kwb.cjs +1 -0
- package/dist/error-handling-CrhTtD88.js +14 -0
- package/dist/filter.mjs +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +308 -1187
- package/dist/form.types.d.ts +1 -1
- package/dist/form.types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm-Cj63v5ny.js +1014 -0
- package/dist/index.esm-DuwT11sx.cjs +1 -0
- package/dist/{metadata-BN57S6W9.cjs → metadata-BJWukIqS.cjs} +1 -1
- package/dist/{metadata-P7DGCgIG.js → metadata-CJuFxytC.js} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.mjs +83 -93
- package/dist/types/constants.d.ts +2 -2
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/workflow/Activity.d.ts +85 -0
- package/dist/workflow/Activity.d.ts.map +1 -0
- package/dist/workflow/ActivityInstance.d.ts +96 -0
- package/dist/workflow/ActivityInstance.d.ts.map +1 -0
- package/dist/workflow/client.d.ts +39 -0
- package/dist/workflow/client.d.ts.map +1 -0
- package/dist/workflow/components/useActivityForm/createActivityItemProxy.d.ts +16 -0
- package/dist/workflow/components/useActivityForm/createActivityItemProxy.d.ts.map +1 -0
- package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts +22 -0
- package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts.map +1 -0
- package/dist/workflow/components/useActivityForm/index.d.ts +3 -0
- package/dist/workflow/components/useActivityForm/index.d.ts.map +1 -0
- package/dist/workflow/components/useActivityForm/types.d.ts +80 -0
- package/dist/workflow/components/useActivityForm/types.d.ts.map +1 -0
- package/dist/workflow/components/useActivityForm/useActivityForm.d.ts +4 -0
- package/dist/workflow/components/useActivityForm/useActivityForm.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/types.d.ts +53 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow.cjs +1 -0
- package/dist/workflow.d.ts +8 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.mjs +565 -0
- package/dist/workflow.types.cjs +1 -0
- package/dist/workflow.types.d.ts +2 -0
- package/dist/workflow.types.d.ts.map +1 -0
- package/dist/workflow.types.mjs +1 -0
- package/docs/workflow.md +703 -0
- package/package.json +21 -1
- package/sdk/api/client.ts +85 -52
- package/sdk/api/index.ts +1 -0
- package/sdk/bdo/core/BaseBdo.ts +10 -0
- package/sdk/components/hooks/useForm/index.ts +1 -0
- package/sdk/components/hooks/useForm/types.ts +17 -3
- package/sdk/components/hooks/useForm/useDraftInteraction.ts +251 -0
- package/sdk/components/hooks/useForm/useForm.ts +106 -19
- package/sdk/form.types.ts +1 -0
- package/sdk/index.ts +6 -0
- package/sdk/types/constants.ts +2 -2
- package/sdk/workflow/Activity.ts +181 -0
- package/sdk/workflow/ActivityInstance.ts +339 -0
- package/sdk/workflow/client.ts +208 -0
- package/sdk/workflow/components/useActivityForm/createActivityItemProxy.ts +126 -0
- package/sdk/workflow/components/useActivityForm/createActivityResolver.ts +61 -0
- package/sdk/workflow/components/useActivityForm/index.ts +5 -0
- package/sdk/workflow/components/useActivityForm/types.ts +166 -0
- package/sdk/workflow/components/useActivityForm/useActivityForm.ts +386 -0
- package/sdk/workflow/index.ts +20 -0
- package/sdk/workflow/types.ts +84 -0
- package/sdk/workflow.ts +25 -0
- package/sdk/workflow.types.ts +11 -0
- package/dist/client-Bo-RLKJi.cjs +0 -1
- package/dist/client-eA4VvNTo.js +0 -178
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Workflow Types - Business Process / Activity Operations
|
|
3
|
+
// ============================================================
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ListOptionsType,
|
|
7
|
+
ListResponseType,
|
|
8
|
+
MetricOptionsType,
|
|
9
|
+
MetricResponseType,
|
|
10
|
+
DraftResponseType,
|
|
11
|
+
CreateUpdateResponseType,
|
|
12
|
+
} from "../types/common";
|
|
13
|
+
|
|
14
|
+
import type {
|
|
15
|
+
StringFieldType,
|
|
16
|
+
SelectFieldType,
|
|
17
|
+
DateTimeFieldType,
|
|
18
|
+
ReferenceFieldType,
|
|
19
|
+
} from "../types/base-fields";
|
|
20
|
+
import type { UserRefType } from "../types/base-fields";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Response from Workflow.start()
|
|
24
|
+
*/
|
|
25
|
+
export interface WorkflowStartResponseType {
|
|
26
|
+
activityId: string;
|
|
27
|
+
activityInstanceId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Response from the activity progress endpoint
|
|
32
|
+
*/
|
|
33
|
+
export interface ActivityProgressType {
|
|
34
|
+
Stage?: string;
|
|
35
|
+
Progress?: number;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* System fields present on every activity instance response.
|
|
41
|
+
* Returned alongside activity-specific fields from `list()` and `read()`.
|
|
42
|
+
*/
|
|
43
|
+
export type ActivityInstanceFieldsType = {
|
|
44
|
+
_id: StringFieldType;
|
|
45
|
+
Status: SelectFieldType<"InProgress" | "Completed">;
|
|
46
|
+
AssignedTo: ReferenceFieldType<UserRefType>;
|
|
47
|
+
CompletedAt: DateTimeFieldType;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Unified activity operations — returned by Workflow.activity(activityId)
|
|
52
|
+
*
|
|
53
|
+
* List-level methods operate on the activity as a whole.
|
|
54
|
+
* Instance-level methods accept `instanceId` as their first parameter.
|
|
55
|
+
*/
|
|
56
|
+
export interface ActivityOperations<T> {
|
|
57
|
+
// ── List-level ──────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
/** List activity instances (POST .../list) */
|
|
60
|
+
list(options?: ListOptionsType): Promise<ListResponseType<ActivityInstanceFieldsType & T>>;
|
|
61
|
+
|
|
62
|
+
/** Get activity metrics (POST .../metric) */
|
|
63
|
+
metric(options: Omit<MetricOptionsType, "Type">): Promise<MetricResponseType>;
|
|
64
|
+
|
|
65
|
+
// ── Instance-level ──────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
/** Read the activity instance data (GET .../read) */
|
|
68
|
+
read(instanceId: string): Promise<ActivityInstanceFieldsType & T>;
|
|
69
|
+
|
|
70
|
+
/** Update the activity instance (POST .../update) */
|
|
71
|
+
update(instanceId: string, data: Partial<T>): Promise<CreateUpdateResponseType>;
|
|
72
|
+
|
|
73
|
+
/** Start a draft edit session (PATCH .../draft) */
|
|
74
|
+
draftStart(instanceId: string, data: Partial<T>): Promise<DraftResponseType>;
|
|
75
|
+
|
|
76
|
+
/** End a draft edit session and commit (POST .../draft) */
|
|
77
|
+
draftEnd(instanceId: string, data: Partial<T>): Promise<CreateUpdateResponseType>;
|
|
78
|
+
|
|
79
|
+
/** Complete the activity (POST .../done) */
|
|
80
|
+
complete(instanceId: string): Promise<CreateUpdateResponseType>;
|
|
81
|
+
|
|
82
|
+
/** Get activity progress (GET .../progress) */
|
|
83
|
+
progress(instanceId: string): Promise<ActivityProgressType>;
|
|
84
|
+
}
|
package/sdk/workflow.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// WORKFLOW MODULE - Main Entry Point
|
|
3
|
+
// @ram_28/kf-ai-sdk/workflow
|
|
4
|
+
// ============================================================
|
|
5
|
+
|
|
6
|
+
export { Workflow } from './workflow/client';
|
|
7
|
+
export { Activity } from './workflow/Activity';
|
|
8
|
+
export { ActivityInstance } from './workflow/ActivityInstance';
|
|
9
|
+
export type {
|
|
10
|
+
ActivityInstanceType,
|
|
11
|
+
EditableFieldAccessor,
|
|
12
|
+
ReadonlyFieldAccessor,
|
|
13
|
+
} from './workflow/ActivityInstance';
|
|
14
|
+
export type {
|
|
15
|
+
ActivityInstanceFieldsType,
|
|
16
|
+
ActivityOperations,
|
|
17
|
+
ActivityProgressType,
|
|
18
|
+
WorkflowStartResponseType,
|
|
19
|
+
} from './workflow/types';
|
|
20
|
+
|
|
21
|
+
export { useActivityForm } from './workflow/components/useActivityForm';
|
|
22
|
+
export type {
|
|
23
|
+
UseActivityFormOptions,
|
|
24
|
+
UseActivityFormReturn,
|
|
25
|
+
} from './workflow/components/useActivityForm';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// WORKFLOW MODULE - Type Exports
|
|
3
|
+
// @ram_28/kf-ai-sdk/workflow/types
|
|
4
|
+
// ============================================================
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
ActivityInstanceFieldsType,
|
|
8
|
+
ActivityOperations,
|
|
9
|
+
ActivityProgressType,
|
|
10
|
+
WorkflowStartResponseType,
|
|
11
|
+
} from './workflow/types';
|
package/dist/client-Bo-RLKJi.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";let i={baseUrl:"",headers:{"Content-Type":"application/json"}};function d(s){i.baseUrl=s}function $(s){i.headers={...i.headers,...s}}function r(){return{...i.headers}}function n(){return i.baseUrl||""}async function o(s,e){let t;try{t=await s.json()}catch{}const a=(t==null?void 0:t.error)||(t==null?void 0:t.message)||s.statusText;throw new Error(`${e}: ${a}`)}function h(s){return{async get(e){const t=await fetch(`${n()}/api/app/${s}/${e}/read`,{method:"GET",headers:r()});return t.ok||await o(t,`Failed to get ${s} ${e}`),(await t.json()).Data},async create(e){const t=await fetch(`${n()}/api/app/${s}/create`,{method:"POST",headers:r(),body:JSON.stringify(e)});return t.ok||await o(t,`Failed to create ${s}`),t.json()},async update(e,t){const a=await fetch(`${n()}/api/app/${s}/${e}/update`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to update ${s} ${e}`),a.json()},async delete(e){const t=await fetch(`${n()}/api/app/${s}/${e}/delete`,{method:"DELETE",headers:r()});return t.ok||await o(t,`Failed to delete ${s} ${e}`),t.json()},async list(e){const t={Type:"List",...e},a=await fetch(`${n()}/api/app/${s}/list`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to list ${s}`),await a.json()},async count(e){var p,f;const t={Type:"Metric",GroupBy:[],Metric:[{Field:"_id",Type:"Count"}],...(e==null?void 0:e.Filter)&&{Filter:e.Filter}},a=await fetch(`${n()}/api/app/${s}/metric`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to count ${s}`),{Count:((f=(p=(await a.json()).Data)==null?void 0:p[0])==null?void 0:f.count__id)??0}},async draft(e){const t=await fetch(`${n()}/api/app/${s}/draft`,{method:"POST",headers:r(),body:JSON.stringify(e)});return t.ok||await o(t,`Failed to create draft for ${s}`),t.json()},async draftUpdate(e,t){const a=await fetch(`${n()}/api/app/${s}/${e}/draft`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to update draft for ${s} ${e}`),a.json()},async draftPatch(e,t){const a=await fetch(`${n()}/api/app/${s}/${e}/draft`,{method:"PATCH",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to patch draft for ${s} ${e}`),a.json()},async draftInteraction(e){const t=await fetch(`${n()}/api/app/${s}/draft`,{method:"PATCH",headers:r(),body:JSON.stringify(e)});t.ok||await o(t,`Failed to create interactive draft for ${s}`);const a=await t.json();return{...a.Data,_id:a.Data._id}},async metric(e){const t={Type:"Metric",...e},a=await fetch(`${n()}/api/app/${s}/metric`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to get metrics for ${s}`),a.json()},async pivot(e){const t={Type:"Pivot",...e},a=await fetch(`${n()}/api/app/${s}/pivot`,{method:"POST",headers:r(),body:JSON.stringify(t)});return a.ok||await o(a,`Failed to get pivot data for ${s}`),a.json()},async fields(){const e=await fetch(`${n()}/api/app/${s}/fields`,{method:"GET",headers:r()});return e.ok||await o(e,`Failed to get fields for ${s}`),e.json()},async fetchField(e,t){const a=await fetch(`${n()}/api/app/${s}/${e}/field/${t}/fetch`,{method:"GET",headers:r()});return a.ok||await o(a,`Failed to fetch field ${t} for ${s}`),(await a.json()).Data}}}exports.api=h;exports.getApiBaseUrl=n;exports.getDefaultHeaders=r;exports.setApiBaseUrl=d;exports.setDefaultHeaders=$;
|
package/dist/client-eA4VvNTo.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
let i = {
|
|
2
|
-
baseUrl: "",
|
|
3
|
-
headers: {
|
|
4
|
-
"Content-Type": "application/json"
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
function $(s) {
|
|
8
|
-
i.baseUrl = s;
|
|
9
|
-
}
|
|
10
|
-
function h(s) {
|
|
11
|
-
i.headers = { ...i.headers, ...s };
|
|
12
|
-
}
|
|
13
|
-
function r() {
|
|
14
|
-
return { ...i.headers };
|
|
15
|
-
}
|
|
16
|
-
function n() {
|
|
17
|
-
return i.baseUrl || "";
|
|
18
|
-
}
|
|
19
|
-
async function o(s, e) {
|
|
20
|
-
let t;
|
|
21
|
-
try {
|
|
22
|
-
t = await s.json();
|
|
23
|
-
} catch {
|
|
24
|
-
}
|
|
25
|
-
const a = (t == null ? void 0 : t.error) || (t == null ? void 0 : t.message) || s.statusText;
|
|
26
|
-
throw new Error(`${e}: ${a}`);
|
|
27
|
-
}
|
|
28
|
-
function u(s) {
|
|
29
|
-
return {
|
|
30
|
-
async get(e) {
|
|
31
|
-
const t = await fetch(`${n()}/api/app/${s}/${e}/read`, {
|
|
32
|
-
method: "GET",
|
|
33
|
-
headers: r()
|
|
34
|
-
});
|
|
35
|
-
return t.ok || await o(t, `Failed to get ${s} ${e}`), (await t.json()).Data;
|
|
36
|
-
},
|
|
37
|
-
async create(e) {
|
|
38
|
-
const t = await fetch(`${n()}/api/app/${s}/create`, {
|
|
39
|
-
method: "POST",
|
|
40
|
-
headers: r(),
|
|
41
|
-
body: JSON.stringify(e)
|
|
42
|
-
});
|
|
43
|
-
return t.ok || await o(t, `Failed to create ${s}`), t.json();
|
|
44
|
-
},
|
|
45
|
-
async update(e, t) {
|
|
46
|
-
const a = await fetch(`${n()}/api/app/${s}/${e}/update`, {
|
|
47
|
-
method: "POST",
|
|
48
|
-
headers: r(),
|
|
49
|
-
body: JSON.stringify(t)
|
|
50
|
-
});
|
|
51
|
-
return a.ok || await o(a, `Failed to update ${s} ${e}`), a.json();
|
|
52
|
-
},
|
|
53
|
-
async delete(e) {
|
|
54
|
-
const t = await fetch(`${n()}/api/app/${s}/${e}/delete`, {
|
|
55
|
-
method: "DELETE",
|
|
56
|
-
headers: r()
|
|
57
|
-
});
|
|
58
|
-
return t.ok || await o(t, `Failed to delete ${s} ${e}`), t.json();
|
|
59
|
-
},
|
|
60
|
-
async list(e) {
|
|
61
|
-
const t = {
|
|
62
|
-
Type: "List",
|
|
63
|
-
...e
|
|
64
|
-
}, a = await fetch(`${n()}/api/app/${s}/list`, {
|
|
65
|
-
method: "POST",
|
|
66
|
-
headers: r(),
|
|
67
|
-
body: JSON.stringify(t)
|
|
68
|
-
});
|
|
69
|
-
return a.ok || await o(a, `Failed to list ${s}`), await a.json();
|
|
70
|
-
},
|
|
71
|
-
async count(e) {
|
|
72
|
-
var p, f;
|
|
73
|
-
const t = {
|
|
74
|
-
Type: "Metric",
|
|
75
|
-
GroupBy: [],
|
|
76
|
-
Metric: [{ Field: "_id", Type: "Count" }],
|
|
77
|
-
...(e == null ? void 0 : e.Filter) && { Filter: e.Filter }
|
|
78
|
-
}, a = await fetch(`${n()}/api/app/${s}/metric`, {
|
|
79
|
-
method: "POST",
|
|
80
|
-
headers: r(),
|
|
81
|
-
body: JSON.stringify(t)
|
|
82
|
-
});
|
|
83
|
-
return a.ok || await o(a, `Failed to count ${s}`), { Count: ((f = (p = (await a.json()).Data) == null ? void 0 : p[0]) == null ? void 0 : f.count__id) ?? 0 };
|
|
84
|
-
},
|
|
85
|
-
// ============================================================
|
|
86
|
-
// DRAFT/INTERACTIVE OPERATIONS
|
|
87
|
-
// ============================================================
|
|
88
|
-
async draft(e) {
|
|
89
|
-
const t = await fetch(`${n()}/api/app/${s}/draft`, {
|
|
90
|
-
method: "POST",
|
|
91
|
-
headers: r(),
|
|
92
|
-
body: JSON.stringify(e)
|
|
93
|
-
});
|
|
94
|
-
return t.ok || await o(t, `Failed to create draft for ${s}`), t.json();
|
|
95
|
-
},
|
|
96
|
-
async draftUpdate(e, t) {
|
|
97
|
-
const a = await fetch(`${n()}/api/app/${s}/${e}/draft`, {
|
|
98
|
-
method: "POST",
|
|
99
|
-
headers: r(),
|
|
100
|
-
body: JSON.stringify(t)
|
|
101
|
-
});
|
|
102
|
-
return a.ok || await o(a, `Failed to update draft for ${s} ${e}`), a.json();
|
|
103
|
-
},
|
|
104
|
-
async draftPatch(e, t) {
|
|
105
|
-
const a = await fetch(`${n()}/api/app/${s}/${e}/draft`, {
|
|
106
|
-
method: "PATCH",
|
|
107
|
-
headers: r(),
|
|
108
|
-
body: JSON.stringify(t)
|
|
109
|
-
});
|
|
110
|
-
return a.ok || await o(a, `Failed to patch draft for ${s} ${e}`), a.json();
|
|
111
|
-
},
|
|
112
|
-
async draftInteraction(e) {
|
|
113
|
-
const t = await fetch(`${n()}/api/app/${s}/draft`, {
|
|
114
|
-
method: "PATCH",
|
|
115
|
-
headers: r(),
|
|
116
|
-
body: JSON.stringify(e)
|
|
117
|
-
});
|
|
118
|
-
t.ok || await o(t, `Failed to create interactive draft for ${s}`);
|
|
119
|
-
const a = await t.json();
|
|
120
|
-
return {
|
|
121
|
-
...a.Data,
|
|
122
|
-
_id: a.Data._id
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
// ============================================================
|
|
126
|
-
// QUERY OPERATIONS
|
|
127
|
-
// ============================================================
|
|
128
|
-
async metric(e) {
|
|
129
|
-
const t = {
|
|
130
|
-
Type: "Metric",
|
|
131
|
-
...e
|
|
132
|
-
}, a = await fetch(`${n()}/api/app/${s}/metric`, {
|
|
133
|
-
method: "POST",
|
|
134
|
-
headers: r(),
|
|
135
|
-
body: JSON.stringify(t)
|
|
136
|
-
});
|
|
137
|
-
return a.ok || await o(a, `Failed to get metrics for ${s}`), a.json();
|
|
138
|
-
},
|
|
139
|
-
async pivot(e) {
|
|
140
|
-
const t = {
|
|
141
|
-
Type: "Pivot",
|
|
142
|
-
...e
|
|
143
|
-
}, a = await fetch(`${n()}/api/app/${s}/pivot`, {
|
|
144
|
-
method: "POST",
|
|
145
|
-
headers: r(),
|
|
146
|
-
body: JSON.stringify(t)
|
|
147
|
-
});
|
|
148
|
-
return a.ok || await o(a, `Failed to get pivot data for ${s}`), a.json();
|
|
149
|
-
},
|
|
150
|
-
// ============================================================
|
|
151
|
-
// METADATA OPERATIONS
|
|
152
|
-
// ============================================================
|
|
153
|
-
async fields() {
|
|
154
|
-
const e = await fetch(`${n()}/api/app/${s}/fields`, {
|
|
155
|
-
method: "GET",
|
|
156
|
-
headers: r()
|
|
157
|
-
});
|
|
158
|
-
return e.ok || await o(e, `Failed to get fields for ${s}`), e.json();
|
|
159
|
-
},
|
|
160
|
-
async fetchField(e, t) {
|
|
161
|
-
const a = await fetch(
|
|
162
|
-
`${n()}/api/app/${s}/${e}/field/${t}/fetch`,
|
|
163
|
-
{
|
|
164
|
-
method: "GET",
|
|
165
|
-
headers: r()
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
return a.ok || await o(a, `Failed to fetch field ${t} for ${s}`), (await a.json()).Data;
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
export {
|
|
173
|
-
u as a,
|
|
174
|
-
h as b,
|
|
175
|
-
n as c,
|
|
176
|
-
r as g,
|
|
177
|
-
$ as s
|
|
178
|
-
};
|