instill-sdk 0.0.2 → 0.0.4
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 +62 -42
- package/dist/{chunk-3VVR3XHW.mjs → chunk-3NVQTT4B.mjs} +5 -5
- package/dist/chunk-4BC7UGYC.mjs +114 -0
- package/dist/chunk-4CRJTVPW.mjs +132 -0
- package/dist/{chunk-JONZWFL5.mjs → chunk-4LUKB34H.mjs} +48 -52
- package/dist/chunk-5FTGMS4X.mjs +46 -0
- package/dist/chunk-6K6UDAWM.mjs +114 -0
- package/dist/{chunk-IPW3WQCQ.mjs → chunk-7VLTGUGU.mjs} +18 -1
- package/dist/chunk-DZXTDWWF.mjs +69 -0
- package/dist/{chunk-4VWYH26Q.mjs → chunk-EI3U4WOS.mjs} +1 -1
- package/dist/{chunk-KHFNAMT4.mjs → chunk-GEEYB6IX.mjs} +1 -1
- package/dist/{chunk-G5M7VUJT.mjs → chunk-GFLAFXAN.mjs} +1 -1
- package/dist/chunk-GX3ELROF.mjs +141 -0
- package/dist/{chunk-YK7RY2CG.mjs → chunk-I4VMGZBF.mjs} +104 -32
- package/dist/{chunk-YXNMG2RZ.mjs → chunk-JBSVFVPW.mjs} +1 -1
- package/dist/{chunk-NRP5M7FG.mjs → chunk-K7AV4FXF.mjs} +13 -11
- package/dist/{chunk-DIAPO2ML.mjs → chunk-LIXOPQVC.mjs} +20 -9
- package/dist/{chunk-EBWGEVUX.mjs → chunk-QG4SF5DT.mjs} +5 -1
- package/dist/{chunk-GPM5FDRS.mjs → chunk-SFKHRD33.mjs} +18 -18
- package/dist/{chunk-MS2EILMH.mjs → chunk-V2NMRJ2Y.mjs} +20 -16
- package/dist/connector/ConnectorClient.d.ts +32 -32
- package/dist/connector/ConnectorClient.js +90 -85
- package/dist/connector/ConnectorClient.mjs +5 -5
- package/dist/connector/action.d.ts +19 -9
- package/dist/connector/action.js +17 -17
- package/dist/connector/action.mjs +7 -7
- package/dist/connector/index.mjs +5 -5
- package/dist/connector/mutation.d.ts +13 -13
- package/dist/connector/mutation.js +35 -30
- package/dist/connector/mutation.mjs +9 -9
- package/dist/connector/queries.d.ts +11 -11
- package/dist/connector/queries.js +26 -22
- package/dist/connector/queries.mjs +10 -10
- package/dist/connector/types.d.ts +36 -50
- package/dist/helper/getQueryString.d.ts +3 -2
- package/dist/helper/getQueryString.js +5 -1
- package/dist/helper/getQueryString.mjs +1 -1
- package/dist/helper/getQueryString.test.js +5 -1
- package/dist/helper/getQueryString.test.mjs +1 -1
- package/dist/helper/index.js +5 -1
- package/dist/helper/index.mjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +573 -143
- package/dist/index.mjs +55 -20
- package/dist/metric/MetricClient.js +5 -1
- package/dist/metric/MetricClient.mjs +3 -3
- package/dist/metric/pipeline/queries.js +5 -1
- package/dist/metric/pipeline/queries.mjs +2 -2
- package/dist/mgmt/AuthClient.d.ts +9 -3
- package/dist/mgmt/AuthClient.js +51 -11
- package/dist/mgmt/AuthClient.mjs +5 -5
- package/dist/mgmt/action.d.ts +4 -0
- package/dist/mgmt/action.js +20 -2
- package/dist/mgmt/action.mjs +5 -3
- package/dist/mgmt/index.d.ts +0 -1
- package/dist/mgmt/index.mjs +6 -7
- package/dist/mgmt/mutation.d.ts +4 -4
- package/dist/mgmt/mutation.js +6 -6
- package/dist/mgmt/mutation.mjs +3 -3
- package/dist/mgmt/queries.d.ts +14 -2
- package/dist/mgmt/queries.js +67 -5
- package/dist/mgmt/queries.mjs +10 -4
- package/dist/mgmt/types.d.ts +62 -1
- package/dist/mgmt/types.mjs +0 -1
- package/dist/model/ModelClient.js +5 -1
- package/dist/model/ModelClient.mjs +3 -3
- package/dist/model/index.mjs +3 -3
- package/dist/model/queries.js +5 -1
- package/dist/model/queries.mjs +2 -2
- package/dist/organization/OrganizationClient.d.ts +43 -0
- package/dist/organization/OrganizationClient.js +378 -0
- package/dist/organization/OrganizationClient.mjs +15 -0
- package/dist/organization/index.d.ts +2 -0
- package/dist/organization/index.js +310 -0
- package/dist/organization/index.mjs +40 -0
- package/dist/organization/mutations.d.ts +32 -0
- package/dist/organization/mutations.js +144 -0
- package/dist/organization/mutations.mjs +19 -0
- package/dist/organization/queries.d.ts +34 -0
- package/dist/organization/queries.js +191 -0
- package/dist/organization/queries.mjs +23 -0
- package/dist/organization/types.d.ts +81 -0
- package/dist/organization/types.js +18 -0
- package/dist/organization/types.mjs +0 -0
- package/dist/pipeline/PipelineClient.d.ts +7 -5
- package/dist/pipeline/PipelineClient.js +81 -47
- package/dist/pipeline/PipelineClient.mjs +4 -4
- package/dist/pipeline/action.d.ts +13 -12
- package/dist/pipeline/action.js +13 -11
- package/dist/pipeline/action.mjs +1 -1
- package/dist/pipeline/index.mjs +5 -5
- package/dist/pipeline/queries.d.ts +37 -18
- package/dist/pipeline/queries.js +110 -32
- package/dist/pipeline/queries.mjs +8 -4
- package/dist/pipeline/types.d.ts +89 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +53 -2
- package/package.json +1 -2
- package/dist/chunk-6M57XUNI.mjs +0 -64
- package/dist/chunk-VIPORJ6H.mjs +0 -77
- package/dist/chunk-YT6ZGA4J.mjs +0 -46
- /package/dist/{chunk-JY37AKV6.mjs → chunk-IESWEQM7.mjs} +0 -0
- /package/dist/{chunk-VASX6R4R.mjs → chunk-ZVLPH226.mjs} +0 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/organization/index.ts
|
|
31
|
+
var organization_exports = {};
|
|
32
|
+
__export(organization_exports, {
|
|
33
|
+
createOrganizationMutation: () => createOrganizationMutation,
|
|
34
|
+
deleteOrganizationMembershipMutation: () => deleteOrganizationMembershipMutation,
|
|
35
|
+
deleteOrganizationMutation: () => deleteOrganizationMutation,
|
|
36
|
+
deleteUserMembershipMutation: () => deleteUserMembershipMutation,
|
|
37
|
+
getOrganizationMembershipQuery: () => getOrganizationMembershipQuery,
|
|
38
|
+
getOrganizationMembershipsQuery: () => getOrganizationMembershipsQuery,
|
|
39
|
+
getOrganizationQuery: () => getOrganizationQuery,
|
|
40
|
+
getUserMembershipQuery: () => getUserMembershipQuery,
|
|
41
|
+
getUserMembershipsQuery: () => getUserMembershipsQuery,
|
|
42
|
+
listOrganizationsQuery: () => listOrganizationsQuery,
|
|
43
|
+
updateOrganizationMembershipMutation: () => updateOrganizationMembershipMutation,
|
|
44
|
+
updateOrganizationMutation: () => updateOrganizationMutation,
|
|
45
|
+
updateUserMembershipMutation: () => updateUserMembershipMutation
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(organization_exports);
|
|
48
|
+
|
|
49
|
+
// src/organization/mutations.ts
|
|
50
|
+
async function createOrganizationMutation({
|
|
51
|
+
payload,
|
|
52
|
+
axiosInstance
|
|
53
|
+
}) {
|
|
54
|
+
try {
|
|
55
|
+
const { data } = await axiosInstance.post(
|
|
56
|
+
"/organizations",
|
|
57
|
+
payload
|
|
58
|
+
);
|
|
59
|
+
return Promise.resolve(data.organization);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
return Promise.reject(err);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function updateOrganizationMutation({
|
|
65
|
+
payload,
|
|
66
|
+
axiosInstance
|
|
67
|
+
}) {
|
|
68
|
+
try {
|
|
69
|
+
const { data } = await axiosInstance.patch(
|
|
70
|
+
`/organizations/${payload.id}`,
|
|
71
|
+
{
|
|
72
|
+
...payload,
|
|
73
|
+
id: void 0
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
return Promise.resolve(data.organization);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
return Promise.reject(err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function updateOrganizationMembershipMutation({
|
|
82
|
+
payload,
|
|
83
|
+
axiosInstance
|
|
84
|
+
}) {
|
|
85
|
+
try {
|
|
86
|
+
const { data } = await axiosInstance.put(
|
|
87
|
+
`/organizations/${payload.organizationID}/memberships/${payload.userID}`,
|
|
88
|
+
{
|
|
89
|
+
...payload,
|
|
90
|
+
organizationID: void 0,
|
|
91
|
+
userID: void 0
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
return Promise.resolve(data.membership);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
return Promise.reject(err);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function deleteOrganizationMutation({
|
|
100
|
+
organizationName,
|
|
101
|
+
axiosInstance
|
|
102
|
+
}) {
|
|
103
|
+
try {
|
|
104
|
+
await axiosInstance.delete(`/organizations/${organizationName}`);
|
|
105
|
+
} catch (err) {
|
|
106
|
+
return Promise.reject(err);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function deleteOrganizationMembershipMutation({
|
|
110
|
+
organizationID,
|
|
111
|
+
userID,
|
|
112
|
+
axiosInstance
|
|
113
|
+
}) {
|
|
114
|
+
try {
|
|
115
|
+
await axiosInstance.delete(
|
|
116
|
+
`/organizations/${organizationID}/memberships/${userID}`
|
|
117
|
+
);
|
|
118
|
+
} catch (err) {
|
|
119
|
+
return Promise.reject(err);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function deleteUserMembershipMutation({
|
|
123
|
+
organizationID,
|
|
124
|
+
userID,
|
|
125
|
+
axiosInstance
|
|
126
|
+
}) {
|
|
127
|
+
try {
|
|
128
|
+
await axiosInstance.delete(
|
|
129
|
+
`/users/${userID}/memberships/${organizationID}`
|
|
130
|
+
);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
return Promise.reject(err);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function updateUserMembershipMutation({
|
|
136
|
+
payload,
|
|
137
|
+
axiosInstance
|
|
138
|
+
}) {
|
|
139
|
+
try {
|
|
140
|
+
const { data } = await axiosInstance.put(
|
|
141
|
+
`/users/${payload.userID}/memberships/${payload.organizationID}`,
|
|
142
|
+
{
|
|
143
|
+
...payload,
|
|
144
|
+
organizationID: void 0,
|
|
145
|
+
userID: void 0
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
return Promise.resolve(data.membership);
|
|
149
|
+
} catch (err) {
|
|
150
|
+
return Promise.reject(err);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/helper/createClient.ts
|
|
155
|
+
var import_axios = __toESM(require("axios"));
|
|
156
|
+
|
|
157
|
+
// src/helper/getQueryString.ts
|
|
158
|
+
var getQueryString = ({
|
|
159
|
+
baseURL,
|
|
160
|
+
pageSize,
|
|
161
|
+
nextPageToken,
|
|
162
|
+
filter,
|
|
163
|
+
queryParams
|
|
164
|
+
}) => {
|
|
165
|
+
let url = baseURL;
|
|
166
|
+
if (pageSize || nextPageToken || filter) {
|
|
167
|
+
if (baseURL.includes("?")) {
|
|
168
|
+
url += "&";
|
|
169
|
+
} else {
|
|
170
|
+
url += "?";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (pageSize) {
|
|
174
|
+
url += `page_size=${pageSize}&`;
|
|
175
|
+
}
|
|
176
|
+
if (nextPageToken) {
|
|
177
|
+
url += `page_token=${nextPageToken}&`;
|
|
178
|
+
}
|
|
179
|
+
if (filter) {
|
|
180
|
+
url += `filter=${filter}&`;
|
|
181
|
+
}
|
|
182
|
+
if (queryParams) {
|
|
183
|
+
url += `${queryParams}&`;
|
|
184
|
+
}
|
|
185
|
+
if (url.endsWith("&")) {
|
|
186
|
+
url = url.slice(0, -1);
|
|
187
|
+
}
|
|
188
|
+
return url;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/helper/axiosInstance.ts
|
|
192
|
+
var import_axios2 = __toESM(require("axios"));
|
|
193
|
+
|
|
194
|
+
// src/organization/queries.ts
|
|
195
|
+
async function listOrganizationsQuery({
|
|
196
|
+
axiosInstance,
|
|
197
|
+
pageSize,
|
|
198
|
+
nextPageToken,
|
|
199
|
+
filter
|
|
200
|
+
}) {
|
|
201
|
+
try {
|
|
202
|
+
const organizations = [];
|
|
203
|
+
const queryString = getQueryString({
|
|
204
|
+
baseURL: "/organizations",
|
|
205
|
+
pageSize,
|
|
206
|
+
nextPageToken,
|
|
207
|
+
filter
|
|
208
|
+
});
|
|
209
|
+
const { data } = await axiosInstance.get(
|
|
210
|
+
queryString
|
|
211
|
+
);
|
|
212
|
+
organizations.push(...data.organizations);
|
|
213
|
+
if (data.next_page_token) {
|
|
214
|
+
organizations.push(
|
|
215
|
+
...await listOrganizationsQuery({
|
|
216
|
+
axiosInstance,
|
|
217
|
+
pageSize,
|
|
218
|
+
nextPageToken: data.next_page_token,
|
|
219
|
+
filter
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
return Promise.resolve(organizations);
|
|
224
|
+
} catch (err) {
|
|
225
|
+
return Promise.reject(err);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function getOrganizationQuery({
|
|
229
|
+
organizationID,
|
|
230
|
+
axiosInstance
|
|
231
|
+
}) {
|
|
232
|
+
try {
|
|
233
|
+
const { data } = await axiosInstance.get(
|
|
234
|
+
`/organizations/${organizationID}`
|
|
235
|
+
);
|
|
236
|
+
return Promise.resolve(data.organization);
|
|
237
|
+
} catch (err) {
|
|
238
|
+
return Promise.reject(err);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function getOrganizationMembershipsQuery({
|
|
242
|
+
organizationID,
|
|
243
|
+
axiosInstance
|
|
244
|
+
}) {
|
|
245
|
+
try {
|
|
246
|
+
const { data } = await axiosInstance.get(
|
|
247
|
+
`/organizations/${organizationID}/memberships`
|
|
248
|
+
);
|
|
249
|
+
return Promise.resolve(data.memberships);
|
|
250
|
+
} catch (err) {
|
|
251
|
+
return Promise.reject(err);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async function getOrganizationMembershipQuery({
|
|
255
|
+
organizationID,
|
|
256
|
+
userID,
|
|
257
|
+
axiosInstance
|
|
258
|
+
}) {
|
|
259
|
+
try {
|
|
260
|
+
const { data } = await axiosInstance.get(
|
|
261
|
+
`/organizations/${organizationID}/memberships/${userID}`
|
|
262
|
+
);
|
|
263
|
+
return Promise.resolve(data.membership);
|
|
264
|
+
} catch (err) {
|
|
265
|
+
return Promise.reject(err);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
async function getUserMembershipsQuery({
|
|
269
|
+
userID,
|
|
270
|
+
axiosInstance
|
|
271
|
+
}) {
|
|
272
|
+
try {
|
|
273
|
+
const { data } = await axiosInstance.get(
|
|
274
|
+
`users/${userID}/memberships`
|
|
275
|
+
);
|
|
276
|
+
return Promise.resolve(data.memberships);
|
|
277
|
+
} catch (err) {
|
|
278
|
+
return Promise.reject(err);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
async function getUserMembershipQuery({
|
|
282
|
+
userID,
|
|
283
|
+
organizationID,
|
|
284
|
+
axiosInstance
|
|
285
|
+
}) {
|
|
286
|
+
try {
|
|
287
|
+
const { data } = await axiosInstance.get(
|
|
288
|
+
`users/${userID}/memberships/${organizationID}`
|
|
289
|
+
);
|
|
290
|
+
return Promise.resolve(data.memberships);
|
|
291
|
+
} catch (err) {
|
|
292
|
+
return Promise.reject(err);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
296
|
+
0 && (module.exports = {
|
|
297
|
+
createOrganizationMutation,
|
|
298
|
+
deleteOrganizationMembershipMutation,
|
|
299
|
+
deleteOrganizationMutation,
|
|
300
|
+
deleteUserMembershipMutation,
|
|
301
|
+
getOrganizationMembershipQuery,
|
|
302
|
+
getOrganizationMembershipsQuery,
|
|
303
|
+
getOrganizationQuery,
|
|
304
|
+
getUserMembershipQuery,
|
|
305
|
+
getUserMembershipsQuery,
|
|
306
|
+
listOrganizationsQuery,
|
|
307
|
+
updateOrganizationMembershipMutation,
|
|
308
|
+
updateOrganizationMutation,
|
|
309
|
+
updateUserMembershipMutation
|
|
310
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../chunk-IESWEQM7.mjs";
|
|
2
|
+
import {
|
|
3
|
+
createOrganizationMutation,
|
|
4
|
+
deleteOrganizationMembershipMutation,
|
|
5
|
+
deleteOrganizationMutation,
|
|
6
|
+
deleteUserMembershipMutation,
|
|
7
|
+
updateOrganizationMembershipMutation,
|
|
8
|
+
updateOrganizationMutation,
|
|
9
|
+
updateUserMembershipMutation
|
|
10
|
+
} from "../chunk-4BC7UGYC.mjs";
|
|
11
|
+
import {
|
|
12
|
+
getOrganizationMembershipQuery,
|
|
13
|
+
getOrganizationMembershipsQuery,
|
|
14
|
+
getOrganizationQuery,
|
|
15
|
+
getUserMembershipQuery,
|
|
16
|
+
getUserMembershipsQuery,
|
|
17
|
+
listOrganizationsQuery
|
|
18
|
+
} from "../chunk-6K6UDAWM.mjs";
|
|
19
|
+
import "../chunk-6ZXT6X3H.mjs";
|
|
20
|
+
import "../chunk-JTTE7IZY.mjs";
|
|
21
|
+
import "../chunk-DXEIDDIA.mjs";
|
|
22
|
+
import "../chunk-RVRM4NPL.mjs";
|
|
23
|
+
import "../chunk-7KV3Y36U.mjs";
|
|
24
|
+
import "../chunk-QG4SF5DT.mjs";
|
|
25
|
+
import "../chunk-EXJ4UK7Q.mjs";
|
|
26
|
+
export {
|
|
27
|
+
createOrganizationMutation,
|
|
28
|
+
deleteOrganizationMembershipMutation,
|
|
29
|
+
deleteOrganizationMutation,
|
|
30
|
+
deleteUserMembershipMutation,
|
|
31
|
+
getOrganizationMembershipQuery,
|
|
32
|
+
getOrganizationMembershipsQuery,
|
|
33
|
+
getOrganizationQuery,
|
|
34
|
+
getUserMembershipQuery,
|
|
35
|
+
getUserMembershipsQuery,
|
|
36
|
+
listOrganizationsQuery,
|
|
37
|
+
updateOrganizationMembershipMutation,
|
|
38
|
+
updateOrganizationMutation,
|
|
39
|
+
updateUserMembershipMutation
|
|
40
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { CreateOrganizationPayload, UpdateOrganizationPayload, UpdateOrganizationMembershipPayload, UpdateUserMembershipPayload } from "./types";
|
|
3
|
+
export declare function createOrganizationMutation({ payload, axiosInstance, }: {
|
|
4
|
+
payload: CreateOrganizationPayload;
|
|
5
|
+
axiosInstance: AxiosInstance;
|
|
6
|
+
}): Promise<import("./types").Organization>;
|
|
7
|
+
export declare function updateOrganizationMutation({ payload, axiosInstance, }: {
|
|
8
|
+
payload: UpdateOrganizationPayload;
|
|
9
|
+
axiosInstance: AxiosInstance;
|
|
10
|
+
}): Promise<import("./types").Organization>;
|
|
11
|
+
export declare function updateOrganizationMembershipMutation({ payload, axiosInstance, }: {
|
|
12
|
+
payload: UpdateOrganizationMembershipPayload;
|
|
13
|
+
axiosInstance: AxiosInstance;
|
|
14
|
+
}): Promise<import("./types").OrganizationMembership>;
|
|
15
|
+
export declare function deleteOrganizationMutation({ organizationName, axiosInstance, }: {
|
|
16
|
+
organizationName: string;
|
|
17
|
+
axiosInstance: AxiosInstance;
|
|
18
|
+
}): Promise<undefined>;
|
|
19
|
+
export declare function deleteOrganizationMembershipMutation({ organizationID, userID, axiosInstance, }: {
|
|
20
|
+
organizationID: string;
|
|
21
|
+
userID: string;
|
|
22
|
+
axiosInstance: AxiosInstance;
|
|
23
|
+
}): Promise<undefined>;
|
|
24
|
+
export declare function deleteUserMembershipMutation({ organizationID, userID, axiosInstance, }: {
|
|
25
|
+
organizationID: string;
|
|
26
|
+
userID: string;
|
|
27
|
+
axiosInstance: AxiosInstance;
|
|
28
|
+
}): Promise<undefined>;
|
|
29
|
+
export declare function updateUserMembershipMutation({ payload, axiosInstance, }: {
|
|
30
|
+
payload: UpdateUserMembershipPayload;
|
|
31
|
+
axiosInstance: AxiosInstance;
|
|
32
|
+
}): Promise<import("./types").UserMembership>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/organization/mutations.ts
|
|
21
|
+
var mutations_exports = {};
|
|
22
|
+
__export(mutations_exports, {
|
|
23
|
+
createOrganizationMutation: () => createOrganizationMutation,
|
|
24
|
+
deleteOrganizationMembershipMutation: () => deleteOrganizationMembershipMutation,
|
|
25
|
+
deleteOrganizationMutation: () => deleteOrganizationMutation,
|
|
26
|
+
deleteUserMembershipMutation: () => deleteUserMembershipMutation,
|
|
27
|
+
updateOrganizationMembershipMutation: () => updateOrganizationMembershipMutation,
|
|
28
|
+
updateOrganizationMutation: () => updateOrganizationMutation,
|
|
29
|
+
updateUserMembershipMutation: () => updateUserMembershipMutation
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(mutations_exports);
|
|
32
|
+
async function createOrganizationMutation({
|
|
33
|
+
payload,
|
|
34
|
+
axiosInstance
|
|
35
|
+
}) {
|
|
36
|
+
try {
|
|
37
|
+
const { data } = await axiosInstance.post(
|
|
38
|
+
"/organizations",
|
|
39
|
+
payload
|
|
40
|
+
);
|
|
41
|
+
return Promise.resolve(data.organization);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
return Promise.reject(err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function updateOrganizationMutation({
|
|
47
|
+
payload,
|
|
48
|
+
axiosInstance
|
|
49
|
+
}) {
|
|
50
|
+
try {
|
|
51
|
+
const { data } = await axiosInstance.patch(
|
|
52
|
+
`/organizations/${payload.id}`,
|
|
53
|
+
{
|
|
54
|
+
...payload,
|
|
55
|
+
id: void 0
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
return Promise.resolve(data.organization);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
return Promise.reject(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function updateOrganizationMembershipMutation({
|
|
64
|
+
payload,
|
|
65
|
+
axiosInstance
|
|
66
|
+
}) {
|
|
67
|
+
try {
|
|
68
|
+
const { data } = await axiosInstance.put(
|
|
69
|
+
`/organizations/${payload.organizationID}/memberships/${payload.userID}`,
|
|
70
|
+
{
|
|
71
|
+
...payload,
|
|
72
|
+
organizationID: void 0,
|
|
73
|
+
userID: void 0
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
return Promise.resolve(data.membership);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
return Promise.reject(err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function deleteOrganizationMutation({
|
|
82
|
+
organizationName,
|
|
83
|
+
axiosInstance
|
|
84
|
+
}) {
|
|
85
|
+
try {
|
|
86
|
+
await axiosInstance.delete(`/organizations/${organizationName}`);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
return Promise.reject(err);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function deleteOrganizationMembershipMutation({
|
|
92
|
+
organizationID,
|
|
93
|
+
userID,
|
|
94
|
+
axiosInstance
|
|
95
|
+
}) {
|
|
96
|
+
try {
|
|
97
|
+
await axiosInstance.delete(
|
|
98
|
+
`/organizations/${organizationID}/memberships/${userID}`
|
|
99
|
+
);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
return Promise.reject(err);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function deleteUserMembershipMutation({
|
|
105
|
+
organizationID,
|
|
106
|
+
userID,
|
|
107
|
+
axiosInstance
|
|
108
|
+
}) {
|
|
109
|
+
try {
|
|
110
|
+
await axiosInstance.delete(
|
|
111
|
+
`/users/${userID}/memberships/${organizationID}`
|
|
112
|
+
);
|
|
113
|
+
} catch (err) {
|
|
114
|
+
return Promise.reject(err);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function updateUserMembershipMutation({
|
|
118
|
+
payload,
|
|
119
|
+
axiosInstance
|
|
120
|
+
}) {
|
|
121
|
+
try {
|
|
122
|
+
const { data } = await axiosInstance.put(
|
|
123
|
+
`/users/${payload.userID}/memberships/${payload.organizationID}`,
|
|
124
|
+
{
|
|
125
|
+
...payload,
|
|
126
|
+
organizationID: void 0,
|
|
127
|
+
userID: void 0
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
return Promise.resolve(data.membership);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
return Promise.reject(err);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
+
0 && (module.exports = {
|
|
137
|
+
createOrganizationMutation,
|
|
138
|
+
deleteOrganizationMembershipMutation,
|
|
139
|
+
deleteOrganizationMutation,
|
|
140
|
+
deleteUserMembershipMutation,
|
|
141
|
+
updateOrganizationMembershipMutation,
|
|
142
|
+
updateOrganizationMutation,
|
|
143
|
+
updateUserMembershipMutation
|
|
144
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createOrganizationMutation,
|
|
3
|
+
deleteOrganizationMembershipMutation,
|
|
4
|
+
deleteOrganizationMutation,
|
|
5
|
+
deleteUserMembershipMutation,
|
|
6
|
+
updateOrganizationMembershipMutation,
|
|
7
|
+
updateOrganizationMutation,
|
|
8
|
+
updateUserMembershipMutation
|
|
9
|
+
} from "../chunk-4BC7UGYC.mjs";
|
|
10
|
+
import "../chunk-EXJ4UK7Q.mjs";
|
|
11
|
+
export {
|
|
12
|
+
createOrganizationMutation,
|
|
13
|
+
deleteOrganizationMembershipMutation,
|
|
14
|
+
deleteOrganizationMutation,
|
|
15
|
+
deleteUserMembershipMutation,
|
|
16
|
+
updateOrganizationMembershipMutation,
|
|
17
|
+
updateOrganizationMutation,
|
|
18
|
+
updateUserMembershipMutation
|
|
19
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { Organization, UserMembership } from "./types";
|
|
3
|
+
import { Nullable } from "../types";
|
|
4
|
+
export declare function listOrganizationsQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
|
|
5
|
+
axiosInstance: AxiosInstance;
|
|
6
|
+
pageSize: Nullable<number>;
|
|
7
|
+
nextPageToken: Nullable<string>;
|
|
8
|
+
filter: Nullable<string>;
|
|
9
|
+
}): Promise<Organization[]>;
|
|
10
|
+
export declare function getOrganizationQuery({ organizationID, axiosInstance, }: {
|
|
11
|
+
organizationID: string;
|
|
12
|
+
axiosInstance: AxiosInstance;
|
|
13
|
+
}): Promise<Organization>;
|
|
14
|
+
export declare function getOrganizationMembershipsQuery({ organizationID, axiosInstance, }: {
|
|
15
|
+
organizationID: string;
|
|
16
|
+
axiosInstance: AxiosInstance;
|
|
17
|
+
}): Promise<import("./types").OrganizationMembership[]>;
|
|
18
|
+
export declare function getOrganizationMembershipQuery({ organizationID, userID, axiosInstance, }: {
|
|
19
|
+
organizationID: string;
|
|
20
|
+
userID: string;
|
|
21
|
+
axiosInstance: AxiosInstance;
|
|
22
|
+
}): Promise<import("./types").OrganizationMembership>;
|
|
23
|
+
export type GetUserMembershipsResponse = {
|
|
24
|
+
memberships: UserMembership[];
|
|
25
|
+
};
|
|
26
|
+
export declare function getUserMembershipsQuery({ userID, axiosInstance, }: {
|
|
27
|
+
userID: string;
|
|
28
|
+
axiosInstance: AxiosInstance;
|
|
29
|
+
}): Promise<UserMembership[]>;
|
|
30
|
+
export declare function getUserMembershipQuery({ userID, organizationID, axiosInstance, }: {
|
|
31
|
+
userID: string;
|
|
32
|
+
organizationID: string;
|
|
33
|
+
axiosInstance: AxiosInstance;
|
|
34
|
+
}): Promise<UserMembership[]>;
|