shred-api-client 2.9.5 → 2.9.7
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.ts +18 -22
- package/dist/index.js +22 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1539,25 +1539,15 @@ declare enum Action$1 {
|
|
|
1539
1539
|
ADD = "ADD",
|
|
1540
1540
|
REMOVE = "REMOVE"
|
|
1541
1541
|
}
|
|
1542
|
-
declare const ReportViewerUpdateSchema: z.ZodObject<{
|
|
1543
|
-
userId: z.ZodString;
|
|
1544
|
-
action: z.ZodNativeEnum<typeof Action$1>;
|
|
1545
|
-
}, "strip", z.ZodTypeAny, {
|
|
1546
|
-
userId: string;
|
|
1547
|
-
action: Action$1;
|
|
1548
|
-
}, {
|
|
1549
|
-
userId: string;
|
|
1550
|
-
action: Action$1;
|
|
1551
|
-
}>;
|
|
1552
1542
|
declare const MemberUpdateSchema: z.ZodObject<{
|
|
1553
1543
|
userIds: z.ZodArray<z.ZodString, "many">;
|
|
1554
1544
|
action: z.ZodNativeEnum<typeof Action$1>;
|
|
1555
1545
|
}, "strip", z.ZodTypeAny, {
|
|
1556
|
-
action: Action$1;
|
|
1557
1546
|
userIds: string[];
|
|
1558
|
-
}, {
|
|
1559
1547
|
action: Action$1;
|
|
1548
|
+
}, {
|
|
1560
1549
|
userIds: string[];
|
|
1550
|
+
action: Action$1;
|
|
1561
1551
|
}>;
|
|
1562
1552
|
declare const TenantUpdateSchema: z.ZodObject<{
|
|
1563
1553
|
preferences: z.ZodOptional<z.ZodObject<{
|
|
@@ -1705,7 +1695,6 @@ declare const TenantUpdateSchema: z.ZodObject<{
|
|
|
1705
1695
|
} | undefined;
|
|
1706
1696
|
reportUrl?: string | undefined;
|
|
1707
1697
|
}>;
|
|
1708
|
-
type ReportViewerUpdate = z.infer<typeof ReportViewerUpdateSchema>;
|
|
1709
1698
|
type MemberUpdate = z.infer<typeof MemberUpdateSchema>;
|
|
1710
1699
|
type TenantUpdate = z.infer<typeof TenantUpdateSchema>;
|
|
1711
1700
|
type Tenant = z.infer<typeof TenantSchema>;
|
|
@@ -1719,7 +1708,6 @@ interface IAPI$a {
|
|
|
1719
1708
|
getTenant: (context: Context, tenantId?: string) => Promise<Tenant | null>;
|
|
1720
1709
|
getMembers: (context: Context, tenantId: string) => Promise<Member[]>;
|
|
1721
1710
|
update: (tenantId: string, data: TenantUpdate, context: Context) => Promise<boolean>;
|
|
1722
|
-
updateReportViewers: (tenantId: string, reportViewerUpdate: ReportViewerUpdate, context: Context) => Promise<boolean>;
|
|
1723
1711
|
updateMembers: (tenantId: string, memberUpdate: MemberUpdate, context: Context) => Promise<boolean>;
|
|
1724
1712
|
}
|
|
1725
1713
|
declare const Endpoints$9: {
|
|
@@ -1751,10 +1739,6 @@ declare const Endpoints$9: {
|
|
|
1751
1739
|
uri: string;
|
|
1752
1740
|
method: string;
|
|
1753
1741
|
};
|
|
1754
|
-
UpdateReportViewers: {
|
|
1755
|
-
uri: string;
|
|
1756
|
-
method: string;
|
|
1757
|
-
};
|
|
1758
1742
|
UpdateMembers: {
|
|
1759
1743
|
uri: string;
|
|
1760
1744
|
method: string;
|
|
@@ -1767,13 +1751,11 @@ type index$b_MemberUpdate = MemberUpdate;
|
|
|
1767
1751
|
declare const index$b_MemberUpdateSchema: typeof MemberUpdateSchema;
|
|
1768
1752
|
type index$b_Preferences = Preferences;
|
|
1769
1753
|
declare const index$b_PreferencesSchema: typeof PreferencesSchema;
|
|
1770
|
-
type index$b_ReportViewerUpdate = ReportViewerUpdate;
|
|
1771
|
-
declare const index$b_ReportViewerUpdateSchema: typeof ReportViewerUpdateSchema;
|
|
1772
1754
|
declare const index$b_TenantSchema: typeof TenantSchema;
|
|
1773
1755
|
type index$b_TenantUpdate = TenantUpdate;
|
|
1774
1756
|
declare const index$b_TenantUpdateSchema: typeof TenantUpdateSchema;
|
|
1775
1757
|
declare namespace index$b {
|
|
1776
|
-
export { Action$1 as Action, Endpoints$9 as Endpoints, type Tenant as Entity, type IAPI$a as IAPI, type index$b_Member as Member, index$b_MemberSchema as MemberSchema, type index$b_MemberUpdate as MemberUpdate, index$b_MemberUpdateSchema as MemberUpdateSchema, type index$b_Preferences as Preferences, index$b_PreferencesSchema as PreferencesSchema,
|
|
1758
|
+
export { Action$1 as Action, Endpoints$9 as Endpoints, type Tenant as Entity, type IAPI$a as IAPI, type index$b_Member as Member, index$b_MemberSchema as MemberSchema, type index$b_MemberUpdate as MemberUpdate, index$b_MemberUpdateSchema as MemberUpdateSchema, type index$b_Preferences as Preferences, index$b_PreferencesSchema as PreferencesSchema, index$b_TenantSchema as TenantSchema, type index$b_TenantUpdate as TenantUpdate, index$b_TenantUpdateSchema as TenantUpdateSchema };
|
|
1777
1759
|
}
|
|
1778
1760
|
|
|
1779
1761
|
declare const TrackParamSchema: z.ZodObject<{
|
|
@@ -2205,6 +2187,9 @@ interface IAPI$7 {
|
|
|
2205
2187
|
review: (context: Context, projectId: string, revision: string) => Promise<boolean>;
|
|
2206
2188
|
cancel: (context: Context, projectId: string) => Promise<boolean>;
|
|
2207
2189
|
list: (context: Context, query: QueryOptions<Project>) => Promise<Project[]>;
|
|
2190
|
+
getMine: (context: Context, query?: QueryOptions<Project>) => Promise<Project[]>;
|
|
2191
|
+
getAssigned: (context: Context, query?: QueryOptions<Project>) => Promise<Project[]>;
|
|
2192
|
+
getAll: (context: Context, query?: QueryOptions<Project>) => Promise<Project[]>;
|
|
2208
2193
|
start: (context: Context) => Promise<boolean>;
|
|
2209
2194
|
sendToApproval: (context: Context, projectId: string, data: SendToApproval) => Promise<boolean>;
|
|
2210
2195
|
approve: (context: Context, projectId: string, data: Approve) => Promise<boolean>;
|
|
@@ -2229,6 +2214,18 @@ declare const Endpoints$6: {
|
|
|
2229
2214
|
uri: string;
|
|
2230
2215
|
method: string;
|
|
2231
2216
|
};
|
|
2217
|
+
Mine: {
|
|
2218
|
+
uri: string;
|
|
2219
|
+
method: string;
|
|
2220
|
+
};
|
|
2221
|
+
Assigned: {
|
|
2222
|
+
uri: string;
|
|
2223
|
+
method: string;
|
|
2224
|
+
};
|
|
2225
|
+
All: {
|
|
2226
|
+
uri: string;
|
|
2227
|
+
method: string;
|
|
2228
|
+
};
|
|
2232
2229
|
GetNext: {
|
|
2233
2230
|
uri: string;
|
|
2234
2231
|
method: string;
|
|
@@ -3453,7 +3450,6 @@ declare const Actions: {
|
|
|
3453
3450
|
readonly TENANT_UPDATE: "tenant.update";
|
|
3454
3451
|
readonly TENANT_VIEW_MEMBERS: "tenant.view_members";
|
|
3455
3452
|
readonly TENANT_UPDATE_MEMBERS: "tenant.update_members";
|
|
3456
|
-
readonly TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers";
|
|
3457
3453
|
readonly TENANT_VIEW_REPORT: "tenant.view_report";
|
|
3458
3454
|
readonly TENANT_VIEW_MINE: "tenant.view_mine";
|
|
3459
3455
|
readonly OFFER_LIST: "offer.list";
|
package/dist/index.js
CHANGED
|
@@ -4774,18 +4774,6 @@ var TenantAPI = class {
|
|
|
4774
4774
|
);
|
|
4775
4775
|
return data;
|
|
4776
4776
|
}
|
|
4777
|
-
async updateReportViewers(tenantId, reportViewerUpdate, context) {
|
|
4778
|
-
const endpointInfo = tenant_exports.Endpoints.UpdateReportViewers;
|
|
4779
|
-
const endpoint = endpointInfo.uri.replace(":tenantId", tenantId);
|
|
4780
|
-
const data = await this.clientHTTP.makeRequest(
|
|
4781
|
-
this.env,
|
|
4782
|
-
`${endpoint}`,
|
|
4783
|
-
endpointInfo.method,
|
|
4784
|
-
reportViewerUpdate,
|
|
4785
|
-
context
|
|
4786
|
-
);
|
|
4787
|
-
return data;
|
|
4788
|
-
}
|
|
4789
4777
|
async updateMembers(tenantId, memberUpdate, context) {
|
|
4790
4778
|
const endpointInfo = tenant_exports.Endpoints.UpdateMembers;
|
|
4791
4779
|
const endpoint = endpointInfo.uri.replace(":tenantId", tenantId);
|
|
@@ -5179,6 +5167,9 @@ var ProjectSchema = external_exports.object({
|
|
|
5179
5167
|
var Endpoints3 = {
|
|
5180
5168
|
Reorder: { uri: "/projects/reorder/", method: "POST" },
|
|
5181
5169
|
List: { uri: "/projects/list", method: "GET" },
|
|
5170
|
+
Mine: { uri: "/projects/mine", method: "GET" },
|
|
5171
|
+
Assigned: { uri: "/projects/assigned", method: "GET" },
|
|
5172
|
+
All: { uri: "/projects/all", method: "GET" },
|
|
5182
5173
|
GetNext: { uri: "/projects/:userId/next", method: "GET" },
|
|
5183
5174
|
CreateProject: { uri: "/projects/create", method: "POST" },
|
|
5184
5175
|
FindOne: { uri: `/projects/:projectId/`, method: "GET" },
|
|
@@ -5560,6 +5551,25 @@ var ProjectAPI = class {
|
|
|
5560
5551
|
);
|
|
5561
5552
|
return data;
|
|
5562
5553
|
}
|
|
5554
|
+
async getMine(context, query) {
|
|
5555
|
+
return this.fetchProjects(Endpoints3.Mine, context, query);
|
|
5556
|
+
}
|
|
5557
|
+
async getAssigned(context, query) {
|
|
5558
|
+
return this.fetchProjects(Endpoints3.Assigned, context, query);
|
|
5559
|
+
}
|
|
5560
|
+
async getAll(context, query) {
|
|
5561
|
+
return this.fetchProjects(Endpoints3.All, context, query);
|
|
5562
|
+
}
|
|
5563
|
+
async fetchProjects(endpointData, context, query) {
|
|
5564
|
+
const qs = query ? buildQueryString(query) : "";
|
|
5565
|
+
return this.clientHTTP.makeRequest(
|
|
5566
|
+
this.env,
|
|
5567
|
+
`${endpointData.uri}${qs}`,
|
|
5568
|
+
endpointData.method,
|
|
5569
|
+
null,
|
|
5570
|
+
context
|
|
5571
|
+
);
|
|
5572
|
+
}
|
|
5563
5573
|
async deny(ctx, pId, denyFB, categories) {
|
|
5564
5574
|
const endpointData = Endpoints3.Deny;
|
|
5565
5575
|
const endpoint = endpointData.uri.replace(":projectId", pId);
|
|
@@ -6073,7 +6083,6 @@ var Actions = {
|
|
|
6073
6083
|
TENANT_UPDATE: "tenant.update",
|
|
6074
6084
|
TENANT_VIEW_MEMBERS: "tenant.view_members",
|
|
6075
6085
|
TENANT_UPDATE_MEMBERS: "tenant.update_members",
|
|
6076
|
-
TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers",
|
|
6077
6086
|
TENANT_VIEW_REPORT: "tenant.view_report",
|
|
6078
6087
|
TENANT_VIEW_MINE: "tenant.view_mine",
|
|
6079
6088
|
// — Offers —
|
|
@@ -6161,7 +6170,6 @@ var ActionCatalog = {
|
|
|
6161
6170
|
[Actions.TENANT_UPDATE]: { label: "Update any tenant", group: "Tenants" },
|
|
6162
6171
|
[Actions.TENANT_VIEW_MEMBERS]: { label: "View a tenant's members", group: "Tenants" },
|
|
6163
6172
|
[Actions.TENANT_UPDATE_MEMBERS]: { label: "Manage a tenant's members", group: "Tenants" },
|
|
6164
|
-
[Actions.TENANT_UPDATE_REPORT_VIEWERS]: { label: "Manage a tenant's report viewers", group: "Tenants" },
|
|
6165
6173
|
[Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants", scopeable: true },
|
|
6166
6174
|
[Actions.TENANT_VIEW_MINE]: { label: "View your own tenant", group: "Tenants" },
|
|
6167
6175
|
// Offers
|
|
@@ -6418,7 +6426,6 @@ __export(tenant_exports, {
|
|
|
6418
6426
|
MemberSchema: () => MemberSchema,
|
|
6419
6427
|
MemberUpdateSchema: () => MemberUpdateSchema,
|
|
6420
6428
|
PreferencesSchema: () => PreferencesSchema,
|
|
6421
|
-
ReportViewerUpdateSchema: () => ReportViewerUpdateSchema,
|
|
6422
6429
|
TenantSchema: () => TenantSchema,
|
|
6423
6430
|
TenantUpdateSchema: () => TenantUpdateSchema
|
|
6424
6431
|
});
|
|
@@ -6533,10 +6540,6 @@ var Action = /* @__PURE__ */ ((Action2) => {
|
|
|
6533
6540
|
Action2["REMOVE"] = "REMOVE";
|
|
6534
6541
|
return Action2;
|
|
6535
6542
|
})(Action || {});
|
|
6536
|
-
var ReportViewerUpdateSchema = external_exports.object({
|
|
6537
|
-
userId: external_exports.string(),
|
|
6538
|
-
action: external_exports.nativeEnum(Action)
|
|
6539
|
-
});
|
|
6540
6543
|
var MemberUpdateSchema = external_exports.object({
|
|
6541
6544
|
userIds: external_exports.array(external_exports.string()),
|
|
6542
6545
|
action: external_exports.nativeEnum(Action)
|
|
@@ -6576,10 +6579,6 @@ var Endpoints11 = {
|
|
|
6576
6579
|
uri: "/tenants/:tenantId/members",
|
|
6577
6580
|
method: "GET"
|
|
6578
6581
|
},
|
|
6579
|
-
UpdateReportViewers: {
|
|
6580
|
-
uri: "/tenants/:tenantId/report-viewers",
|
|
6581
|
-
method: "PUT"
|
|
6582
|
-
},
|
|
6583
6582
|
UpdateMembers: {
|
|
6584
6583
|
uri: "/tenants/:tenantId/members",
|
|
6585
6584
|
method: "PUT"
|