figmanage 1.0.1 → 1.2.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 +74 -59
- package/dist/cli/analytics.d.ts +3 -0
- package/dist/cli/analytics.js +48 -0
- package/dist/cli/branching.d.ts +3 -0
- package/dist/cli/branching.js +56 -0
- package/dist/cli/comments.d.ts +3 -0
- package/dist/cli/comments.js +86 -0
- package/dist/cli/completion.d.ts +7 -0
- package/dist/cli/completion.js +160 -0
- package/dist/cli/components.d.ts +3 -0
- package/dist/cli/components.js +82 -0
- package/dist/cli/compound-commands.d.ts +14 -0
- package/dist/cli/compound-commands.js +291 -0
- package/dist/cli/export.d.ts +3 -0
- package/dist/cli/export.js +51 -0
- package/dist/cli/files.d.ts +3 -0
- package/dist/cli/files.js +156 -0
- package/dist/cli/format.js +147 -2
- package/dist/cli/helpers.d.ts +7 -0
- package/dist/cli/helpers.js +43 -0
- package/dist/cli/index.js +68 -89
- package/dist/cli/libraries.d.ts +3 -0
- package/dist/cli/libraries.js +26 -0
- package/dist/cli/navigate.d.ts +3 -0
- package/dist/cli/navigate.js +192 -0
- package/dist/cli/org.d.ts +3 -0
- package/dist/cli/org.js +227 -0
- package/dist/cli/permissions.d.ts +3 -0
- package/dist/cli/permissions.js +133 -0
- package/dist/cli/projects.d.ts +3 -0
- package/dist/cli/projects.js +110 -0
- package/dist/cli/reading.d.ts +3 -0
- package/dist/cli/reading.js +51 -0
- package/dist/cli/teams.d.ts +3 -0
- package/dist/cli/teams.js +56 -0
- package/dist/cli/variables.d.ts +3 -0
- package/dist/cli/variables.js +80 -0
- package/dist/cli/versions.d.ts +3 -0
- package/dist/cli/versions.js +46 -0
- package/dist/cli/webhooks.d.ts +3 -0
- package/dist/cli/webhooks.js +100 -0
- package/dist/operations/analytics.d.ts +10 -0
- package/dist/operations/analytics.js +15 -0
- package/dist/operations/branching.d.ts +24 -0
- package/dist/operations/branching.js +41 -0
- package/dist/operations/comments.d.ts +43 -0
- package/dist/operations/comments.js +65 -0
- package/dist/operations/components.d.ts +24 -0
- package/dist/operations/components.js +30 -0
- package/dist/operations/compound-manager.d.ts +101 -0
- package/dist/operations/compound-manager.js +629 -0
- package/dist/operations/compound.d.ts +102 -0
- package/dist/operations/compound.js +595 -0
- package/dist/operations/export.d.ts +19 -0
- package/dist/operations/export.js +27 -0
- package/dist/operations/files.d.ts +55 -0
- package/dist/operations/files.js +89 -0
- package/dist/operations/libraries.d.ts +5 -0
- package/dist/operations/libraries.js +10 -0
- package/dist/operations/navigate.d.ts +99 -0
- package/dist/operations/navigate.js +266 -0
- package/dist/operations/org.d.ts +95 -0
- package/dist/operations/org.js +205 -0
- package/dist/operations/permissions.d.ts +59 -0
- package/dist/operations/permissions.js +112 -0
- package/dist/operations/projects.d.ts +29 -0
- package/dist/operations/projects.js +40 -0
- package/dist/operations/reading.d.ts +12 -0
- package/dist/operations/reading.js +20 -0
- package/dist/operations/teams.d.ts +17 -0
- package/dist/operations/teams.js +17 -0
- package/dist/operations/variables.d.ts +17 -0
- package/dist/operations/variables.js +39 -0
- package/dist/operations/versions.d.ts +23 -0
- package/dist/operations/versions.js +27 -0
- package/dist/operations/webhooks.d.ts +25 -0
- package/dist/operations/webhooks.js +38 -0
- package/dist/tools/analytics.js +6 -16
- package/dist/tools/branching.js +7 -36
- package/dist/tools/comments.js +9 -56
- package/dist/tools/components.js +7 -19
- package/dist/tools/compound-manager.js +21 -644
- package/dist/tools/compound.js +32 -566
- package/dist/tools/export.js +4 -23
- package/dist/tools/files.js +21 -68
- package/dist/tools/libraries.js +4 -11
- package/dist/tools/navigate.js +23 -246
- package/dist/tools/org.js +29 -245
- package/dist/tools/permissions.js +18 -97
- package/dist/tools/projects.js +8 -27
- package/dist/tools/reading.js +5 -15
- package/dist/tools/teams.js +8 -16
- package/dist/tools/variables.js +13 -30
- package/dist/tools/versions.js +6 -24
- package/dist/tools/webhooks.js +7 -24
- package/package.json +1 -1
- package/dist/cli/commands.d.ts +0 -47
- package/dist/cli/commands.js +0 -1204
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { listVersions, createVersion } from '../operations/versions.js';
|
|
3
|
+
import { output, error } from './format.js';
|
|
4
|
+
import { requirePat, requireCookie } from './helpers.js';
|
|
5
|
+
export function versionsCommand() {
|
|
6
|
+
const versions = new Command('versions')
|
|
7
|
+
.description('Manage file version history');
|
|
8
|
+
versions
|
|
9
|
+
.command('list <file-key>')
|
|
10
|
+
.description('List version history for a file')
|
|
11
|
+
.option('--json', 'Force JSON output')
|
|
12
|
+
.action(async (fileKey, options) => {
|
|
13
|
+
try {
|
|
14
|
+
const config = requirePat();
|
|
15
|
+
const result = await listVersions(config, { file_key: fileKey });
|
|
16
|
+
output(result, options);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
versions
|
|
24
|
+
.command('create <file-key>')
|
|
25
|
+
.description('Create a named version (checkpoint)')
|
|
26
|
+
.requiredOption('--title <title>', 'Version title/label')
|
|
27
|
+
.option('--description <text>', 'Version description')
|
|
28
|
+
.option('--json', 'Force JSON output')
|
|
29
|
+
.action(async (fileKey, options) => {
|
|
30
|
+
try {
|
|
31
|
+
const config = requireCookie();
|
|
32
|
+
const result = await createVersion(config, {
|
|
33
|
+
file_key: fileKey,
|
|
34
|
+
title: options.title,
|
|
35
|
+
description: options.description,
|
|
36
|
+
});
|
|
37
|
+
output(result, options);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return versions;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { listWebhooks, createWebhook, updateWebhook, deleteWebhook, } from '../operations/webhooks.js';
|
|
3
|
+
import { output, error } from './format.js';
|
|
4
|
+
import { requirePat } from './helpers.js';
|
|
5
|
+
const VALID_EVENT_TYPES = [
|
|
6
|
+
'FILE_UPDATE',
|
|
7
|
+
'FILE_DELETE',
|
|
8
|
+
'FILE_VERSION_UPDATE',
|
|
9
|
+
'LIBRARY_PUBLISH',
|
|
10
|
+
'FILE_COMMENT',
|
|
11
|
+
'PING',
|
|
12
|
+
];
|
|
13
|
+
export function webhooksCommand() {
|
|
14
|
+
const webhooks = new Command('webhooks')
|
|
15
|
+
.description('Manage team webhooks');
|
|
16
|
+
webhooks
|
|
17
|
+
.command('list <team-id>')
|
|
18
|
+
.description('List webhooks for a team')
|
|
19
|
+
.option('--json', 'Force JSON output')
|
|
20
|
+
.action(async (teamId, options) => {
|
|
21
|
+
try {
|
|
22
|
+
const config = requirePat();
|
|
23
|
+
const result = await listWebhooks(config, { team_id: teamId });
|
|
24
|
+
output(result, options);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
webhooks
|
|
32
|
+
.command('create <team-id>')
|
|
33
|
+
.description('Create a webhook subscription for a team')
|
|
34
|
+
.requiredOption('--event-type <type>', `Event type (${VALID_EVENT_TYPES.join(', ')})`)
|
|
35
|
+
.requiredOption('--endpoint <url>', 'URL to receive webhook payloads')
|
|
36
|
+
.requiredOption('--passcode <secret>', 'Secret for signature verification')
|
|
37
|
+
.option('--description <text>', 'Webhook description')
|
|
38
|
+
.option('--json', 'Force JSON output')
|
|
39
|
+
.action(async (teamId, options) => {
|
|
40
|
+
try {
|
|
41
|
+
const config = requirePat();
|
|
42
|
+
const result = await createWebhook(config, {
|
|
43
|
+
team_id: teamId,
|
|
44
|
+
event_type: options.eventType,
|
|
45
|
+
endpoint: options.endpoint,
|
|
46
|
+
passcode: options.passcode,
|
|
47
|
+
description: options.description,
|
|
48
|
+
});
|
|
49
|
+
output(result, options);
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
webhooks
|
|
57
|
+
.command('update <webhook-id>')
|
|
58
|
+
.description('Update a webhook')
|
|
59
|
+
.option('--event-type <type>', `Event type (${VALID_EVENT_TYPES.join(', ')})`)
|
|
60
|
+
.option('--endpoint <url>', 'URL to receive webhook payloads')
|
|
61
|
+
.option('--passcode <secret>', 'Secret for signature verification')
|
|
62
|
+
.option('--description <text>', 'Webhook description')
|
|
63
|
+
.option('--status <status>', 'Webhook status (ACTIVE, PAUSED)')
|
|
64
|
+
.option('--json', 'Force JSON output')
|
|
65
|
+
.action(async (webhookId, options) => {
|
|
66
|
+
try {
|
|
67
|
+
const config = requirePat();
|
|
68
|
+
const result = await updateWebhook(config, {
|
|
69
|
+
webhook_id: webhookId,
|
|
70
|
+
event_type: options.eventType,
|
|
71
|
+
endpoint: options.endpoint,
|
|
72
|
+
passcode: options.passcode,
|
|
73
|
+
description: options.description,
|
|
74
|
+
status: options.status,
|
|
75
|
+
});
|
|
76
|
+
output(result, options);
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
webhooks
|
|
84
|
+
.command('delete <webhook-id>')
|
|
85
|
+
.description('Delete a webhook')
|
|
86
|
+
.option('--json', 'Force JSON output')
|
|
87
|
+
.action(async (webhookId, options) => {
|
|
88
|
+
try {
|
|
89
|
+
const config = requirePat();
|
|
90
|
+
await deleteWebhook(config, { webhook_id: webhookId });
|
|
91
|
+
output({ deleted: webhookId }, options);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
error(e.response?.status ? `API error: ${e.response.status}` : e.message);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return webhooks;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth/client.js';
|
|
2
|
+
export declare function libraryUsage(config: AuthConfig, params: {
|
|
3
|
+
library_file_key: string;
|
|
4
|
+
days?: number;
|
|
5
|
+
}): Promise<any>;
|
|
6
|
+
export declare function componentUsage(config: AuthConfig, params: {
|
|
7
|
+
component_key: string;
|
|
8
|
+
org_id?: string;
|
|
9
|
+
}): Promise<any>;
|
|
10
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { internalClient } from '../clients/internal-api.js';
|
|
2
|
+
import { requireOrgId } from '../tools/register.js';
|
|
3
|
+
export async function libraryUsage(config, params) {
|
|
4
|
+
const lookback = params.days ?? 30;
|
|
5
|
+
const end_ts = Math.floor(Date.now() / 1000);
|
|
6
|
+
const start_ts = end_ts - lookback * 86400;
|
|
7
|
+
const res = await internalClient(config).get(`/api/dsa/library/${params.library_file_key}/team_usage`, { params: { start_ts, end_ts } });
|
|
8
|
+
return res.data;
|
|
9
|
+
}
|
|
10
|
+
export async function componentUsage(config, params) {
|
|
11
|
+
const orgId = requireOrgId(config, params.org_id);
|
|
12
|
+
const res = await internalClient(config).get(`/api/design_systems/component/${params.component_key}/file_usage`, { params: { org_id: orgId, fv: 4 } });
|
|
13
|
+
return res.data;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth/client.js';
|
|
2
|
+
export interface Branch {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
thumbnail_url: string | null;
|
|
6
|
+
last_modified: string | null;
|
|
7
|
+
link_access: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface CreatedBranch {
|
|
10
|
+
key: string | null;
|
|
11
|
+
name: string;
|
|
12
|
+
main_file_key: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function listBranches(config: AuthConfig, params: {
|
|
15
|
+
file_key: string;
|
|
16
|
+
}): Promise<Branch[]>;
|
|
17
|
+
export declare function createBranch(config: AuthConfig, params: {
|
|
18
|
+
file_key: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}): Promise<CreatedBranch>;
|
|
21
|
+
export declare function deleteBranch(config: AuthConfig, params: {
|
|
22
|
+
branch_key: string;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
//# sourceMappingURL=branching.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { hasCookie } from '../auth/client.js';
|
|
2
|
+
import { publicClient } from '../clients/public-api.js';
|
|
3
|
+
import { internalClient } from '../clients/internal-api.js';
|
|
4
|
+
export async function listBranches(config, params) {
|
|
5
|
+
let branches;
|
|
6
|
+
if (hasCookie(config)) {
|
|
7
|
+
const res = await internalClient(config).get(`/api/files/${params.file_key}`);
|
|
8
|
+
const f = res.data?.meta || res.data;
|
|
9
|
+
branches = f.branches || [];
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const res = await publicClient(config).get(`/v1/files/${params.file_key}`, {
|
|
13
|
+
params: { branch_data: 'true', depth: '0' },
|
|
14
|
+
});
|
|
15
|
+
branches = res.data?.branches || [];
|
|
16
|
+
}
|
|
17
|
+
return branches.map((b) => ({
|
|
18
|
+
key: b.key,
|
|
19
|
+
name: b.name,
|
|
20
|
+
thumbnail_url: b.thumbnail_url || null,
|
|
21
|
+
last_modified: b.last_modified || null,
|
|
22
|
+
link_access: b.link_access || null,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
export async function createBranch(config, params) {
|
|
26
|
+
const res = await internalClient(config).post(`/api/multiplayer/${params.file_key}/branch_create?name=${encodeURIComponent(params.name)}`);
|
|
27
|
+
const meta = res.data?.meta || res.data || {};
|
|
28
|
+
const file = meta.file || meta;
|
|
29
|
+
const branchKey = file.key || file.file_key || null;
|
|
30
|
+
return {
|
|
31
|
+
key: branchKey,
|
|
32
|
+
name: params.name,
|
|
33
|
+
main_file_key: params.file_key,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export async function deleteBranch(config, params) {
|
|
37
|
+
await internalClient(config).delete('/api/files_batch', {
|
|
38
|
+
data: { files: [{ key: params.branch_key }], trashed: true },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=branching.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth/client.js';
|
|
2
|
+
export interface Comment {
|
|
3
|
+
id: string;
|
|
4
|
+
parent_id: string | null;
|
|
5
|
+
message: string;
|
|
6
|
+
author: string;
|
|
7
|
+
author_id: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
resolved_at: string | null;
|
|
10
|
+
node_id: string | null;
|
|
11
|
+
order_id: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PostedComment {
|
|
14
|
+
id: string;
|
|
15
|
+
message: string;
|
|
16
|
+
author: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
parent_id: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface Reaction {
|
|
21
|
+
emoji: string;
|
|
22
|
+
user: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function listComments(config: AuthConfig, params: {
|
|
26
|
+
file_key: string;
|
|
27
|
+
}): Promise<Comment[]>;
|
|
28
|
+
export declare function formatCommentsAsMarkdown(comments: Comment[]): string;
|
|
29
|
+
export declare function postComment(config: AuthConfig, params: {
|
|
30
|
+
file_key: string;
|
|
31
|
+
message: string;
|
|
32
|
+
comment_id?: string;
|
|
33
|
+
node_id?: string;
|
|
34
|
+
}): Promise<PostedComment>;
|
|
35
|
+
export declare function deleteComment(config: AuthConfig, params: {
|
|
36
|
+
file_key: string;
|
|
37
|
+
comment_id: string;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
export declare function listCommentReactions(config: AuthConfig, params: {
|
|
40
|
+
file_key: string;
|
|
41
|
+
comment_id: string;
|
|
42
|
+
}): Promise<Reaction[]>;
|
|
43
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { publicClient } from '../clients/public-api.js';
|
|
2
|
+
export async function listComments(config, params) {
|
|
3
|
+
const res = await publicClient(config).get(`/v1/files/${params.file_key}/comments`);
|
|
4
|
+
const comments = res.data?.comments || [];
|
|
5
|
+
return comments.map((c) => ({
|
|
6
|
+
id: c.id,
|
|
7
|
+
parent_id: c.parent_id || null,
|
|
8
|
+
message: c.message,
|
|
9
|
+
author: c.user?.handle,
|
|
10
|
+
author_id: c.user?.id,
|
|
11
|
+
created_at: c.created_at,
|
|
12
|
+
resolved_at: c.resolved_at || null,
|
|
13
|
+
node_id: c.client_meta?.node_id || c.client_meta?.node_offset?.node_id || null,
|
|
14
|
+
order_id: c.order_id,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
export function formatCommentsAsMarkdown(comments) {
|
|
18
|
+
const threads = new Map();
|
|
19
|
+
for (const c of comments) {
|
|
20
|
+
const parentId = c.parent_id || c.id;
|
|
21
|
+
if (!threads.has(parentId))
|
|
22
|
+
threads.set(parentId, []);
|
|
23
|
+
threads.get(parentId).push(c);
|
|
24
|
+
}
|
|
25
|
+
const lines = [];
|
|
26
|
+
for (const [, thread] of threads) {
|
|
27
|
+
thread.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime());
|
|
28
|
+
for (const c of thread) {
|
|
29
|
+
const indent = c.parent_id ? ' ' : '';
|
|
30
|
+
const resolved = c.resolved_at ? ' [resolved]' : '';
|
|
31
|
+
lines.push(`${indent}- **${c.author}** (${c.created_at})${resolved}: ${c.message}`);
|
|
32
|
+
}
|
|
33
|
+
lines.push('');
|
|
34
|
+
}
|
|
35
|
+
return lines.join('\n');
|
|
36
|
+
}
|
|
37
|
+
export async function postComment(config, params) {
|
|
38
|
+
const body = { message: params.message };
|
|
39
|
+
if (params.comment_id)
|
|
40
|
+
body.comment_id = params.comment_id;
|
|
41
|
+
if (params.node_id)
|
|
42
|
+
body.client_meta = { node_id: params.node_id, node_offset: { x: 0, y: 0 } };
|
|
43
|
+
const res = await publicClient(config).post(`/v1/files/${params.file_key}/comments`, body);
|
|
44
|
+
const c = res.data;
|
|
45
|
+
return {
|
|
46
|
+
id: c.id,
|
|
47
|
+
message: c.message,
|
|
48
|
+
author: c.user?.handle,
|
|
49
|
+
created_at: c.created_at,
|
|
50
|
+
parent_id: c.parent_id || null,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export async function deleteComment(config, params) {
|
|
54
|
+
await publicClient(config).delete(`/v1/files/${params.file_key}/comments/${params.comment_id}`);
|
|
55
|
+
}
|
|
56
|
+
export async function listCommentReactions(config, params) {
|
|
57
|
+
const res = await publicClient(config).get(`/v1/files/${params.file_key}/comments/${params.comment_id}/reactions`);
|
|
58
|
+
const reactions = res.data?.reactions || [];
|
|
59
|
+
return reactions.map((r) => ({
|
|
60
|
+
emoji: r.emoji,
|
|
61
|
+
user: r.user?.handle,
|
|
62
|
+
created_at: r.created_at,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth/client.js';
|
|
2
|
+
export declare function listFileComponents(config: AuthConfig, params: {
|
|
3
|
+
file_key: string;
|
|
4
|
+
}): Promise<any[]>;
|
|
5
|
+
export declare function listFileStyles(config: AuthConfig, params: {
|
|
6
|
+
file_key: string;
|
|
7
|
+
}): Promise<any[]>;
|
|
8
|
+
export declare function listTeamComponents(config: AuthConfig, params: {
|
|
9
|
+
team_id: string;
|
|
10
|
+
page_size?: number;
|
|
11
|
+
cursor?: string;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
components: any[];
|
|
14
|
+
pagination: any;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function listTeamStyles(config: AuthConfig, params: {
|
|
17
|
+
team_id: string;
|
|
18
|
+
page_size?: number;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
styles: any[];
|
|
22
|
+
pagination: any;
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { publicClient } from '../clients/public-api.js';
|
|
2
|
+
export async function listFileComponents(config, params) {
|
|
3
|
+
const res = await publicClient(config).get(`/v1/files/${params.file_key}/components`);
|
|
4
|
+
return res.data?.meta?.components || [];
|
|
5
|
+
}
|
|
6
|
+
export async function listFileStyles(config, params) {
|
|
7
|
+
const res = await publicClient(config).get(`/v1/files/${params.file_key}/styles`);
|
|
8
|
+
return res.data?.meta?.styles || [];
|
|
9
|
+
}
|
|
10
|
+
export async function listTeamComponents(config, params) {
|
|
11
|
+
const queryParams = { page_size: params.page_size ?? 30 };
|
|
12
|
+
if (params.cursor)
|
|
13
|
+
queryParams.after = params.cursor;
|
|
14
|
+
const res = await publicClient(config).get(`/v1/teams/${params.team_id}/components`, { params: queryParams });
|
|
15
|
+
return {
|
|
16
|
+
components: res.data?.meta?.components || [],
|
|
17
|
+
pagination: res.data?.pagination || null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export async function listTeamStyles(config, params) {
|
|
21
|
+
const queryParams = { page_size: params.page_size ?? 30 };
|
|
22
|
+
if (params.cursor)
|
|
23
|
+
queryParams.after = params.cursor;
|
|
24
|
+
const res = await publicClient(config).get(`/v1/teams/${params.team_id}/styles`, { params: queryParams });
|
|
25
|
+
return {
|
|
26
|
+
styles: res.data?.meta?.styles || [],
|
|
27
|
+
pagination: res.data?.pagination || null,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth/client.js';
|
|
2
|
+
export declare function offboardUser(config: AuthConfig, params: {
|
|
3
|
+
user_identifier: string;
|
|
4
|
+
execute: boolean;
|
|
5
|
+
transfer_to?: string;
|
|
6
|
+
org_id?: string;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
user: {
|
|
9
|
+
org_user_id: string;
|
|
10
|
+
user_id: string;
|
|
11
|
+
name: any;
|
|
12
|
+
email: any;
|
|
13
|
+
seat_type: any;
|
|
14
|
+
permission: any;
|
|
15
|
+
};
|
|
16
|
+
team_memberships: {
|
|
17
|
+
team_id: string;
|
|
18
|
+
team_name: string;
|
|
19
|
+
role: string;
|
|
20
|
+
}[];
|
|
21
|
+
project_permissions: {
|
|
22
|
+
project_id: string;
|
|
23
|
+
project_name: string;
|
|
24
|
+
team_name: string;
|
|
25
|
+
role: string;
|
|
26
|
+
}[];
|
|
27
|
+
file_ownership: {
|
|
28
|
+
file_key: string;
|
|
29
|
+
file_name: string;
|
|
30
|
+
project_name: string;
|
|
31
|
+
team_name: string;
|
|
32
|
+
}[];
|
|
33
|
+
summary: {
|
|
34
|
+
teams: number;
|
|
35
|
+
projects_with_access: number;
|
|
36
|
+
files_owned: number;
|
|
37
|
+
};
|
|
38
|
+
transfer_plan: string[];
|
|
39
|
+
note: string;
|
|
40
|
+
executed?: undefined;
|
|
41
|
+
actions?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
user: {
|
|
44
|
+
org_user_id: string;
|
|
45
|
+
user_id: string;
|
|
46
|
+
name: any;
|
|
47
|
+
email: any;
|
|
48
|
+
seat_type: any;
|
|
49
|
+
permission: any;
|
|
50
|
+
};
|
|
51
|
+
executed: boolean;
|
|
52
|
+
actions: {
|
|
53
|
+
action: string;
|
|
54
|
+
status: string;
|
|
55
|
+
detail?: string;
|
|
56
|
+
}[];
|
|
57
|
+
summary: {
|
|
58
|
+
succeeded: number;
|
|
59
|
+
failed: number;
|
|
60
|
+
total: number;
|
|
61
|
+
};
|
|
62
|
+
note: string;
|
|
63
|
+
team_memberships?: undefined;
|
|
64
|
+
project_permissions?: undefined;
|
|
65
|
+
file_ownership?: undefined;
|
|
66
|
+
transfer_plan?: undefined;
|
|
67
|
+
}>;
|
|
68
|
+
export declare function onboardUser(config: AuthConfig, params: {
|
|
69
|
+
email: string;
|
|
70
|
+
team_ids: string[];
|
|
71
|
+
role: string;
|
|
72
|
+
share_files?: string[];
|
|
73
|
+
seat_type?: string;
|
|
74
|
+
confirm?: boolean;
|
|
75
|
+
org_id?: string;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
user_email: string;
|
|
78
|
+
setup_results: {
|
|
79
|
+
teams_joined: {
|
|
80
|
+
team_id: string;
|
|
81
|
+
team_name: string;
|
|
82
|
+
role: string;
|
|
83
|
+
status: string;
|
|
84
|
+
}[];
|
|
85
|
+
files_shared: {
|
|
86
|
+
file_key: string;
|
|
87
|
+
role: string;
|
|
88
|
+
status: string;
|
|
89
|
+
}[];
|
|
90
|
+
seat_change: {
|
|
91
|
+
status: string;
|
|
92
|
+
note?: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
next_steps: string[];
|
|
96
|
+
}>;
|
|
97
|
+
export declare function quarterlyDesignOpsReport(config: AuthConfig, params: {
|
|
98
|
+
org_id?: string;
|
|
99
|
+
days: number;
|
|
100
|
+
}): Promise<Record<string, any>>;
|
|
101
|
+
//# sourceMappingURL=compound-manager.d.ts.map
|