@groton/canvas-api 0.3.1 → 0.3.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/CHANGELOG.md +14 -0
- package/dist/Endpoints/V1/Courses/Assignments/update.d.ts +11 -11
- package/dist/Endpoints/V1/Courses/Folders/ByPath/index.d.ts +1 -1
- package/dist/Endpoints/V1/Courses/Folders/ByPath/index.js +1 -1
- package/dist/Endpoints/V1/Courses/Folders/ByPath/resolve_path_courses_full_path.d.ts +36 -0
- package/dist/Endpoints/V1/Courses/Folders/ByPath/resolve_path_courses_full_path.js +20 -0
- package/dist/Endpoints/V1/Courses/Quizzes/Submissions/Self/Files/upload.d.ts +9 -9
- package/dist/Endpoints/V1/Groups/Folders/ByPath/index.d.ts +1 -1
- package/dist/Endpoints/V1/Groups/Folders/ByPath/index.js +1 -1
- package/dist/Endpoints/V1/Groups/Folders/ByPath/resolve_path_groups_full_path.d.ts +36 -0
- package/dist/Endpoints/V1/Groups/Folders/ByPath/resolve_path_groups_full_path.js +20 -0
- package/dist/Endpoints/V1/Users/Colors/index.d.ts +1 -0
- package/dist/Endpoints/V1/Users/Colors/index.js +1 -0
- package/dist/Endpoints/V1/Users/Colors/list.d.ts +28 -0
- package/dist/Endpoints/V1/Users/Colors/list.js +15 -0
- package/dist/Endpoints/V1/Users/Folders/ByPath/index.d.ts +1 -1
- package/dist/Endpoints/V1/Users/Folders/ByPath/index.js +1 -1
- package/dist/Endpoints/V1/Users/Folders/ByPath/resolve_path_users_full_path.d.ts +36 -0
- package/dist/Endpoints/V1/Users/Folders/ByPath/resolve_path_users_full_path.js +20 -0
- package/package.json +2 -2
- package/var/render.log +1027 -990
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.3.3](https://github.com/groton-school/canvas-cli/compare/api/0.3.2...api/0.3.3) (2025-09-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* get_custom_colors now recognized as list() ([f5512ed](https://github.com/groton-school/canvas-cli/commit/f5512ed819958500b1bba28e05f9e3f6f972a78c))
|
|
11
|
+
|
|
12
|
+
## [0.3.2](https://github.com/groton-school/canvas-cli/compare/api/0.3.1...api/0.3.2) (2025-08-14)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* manually edited spec to make `*full_path` a path parameter ([8d21bde](https://github.com/groton-school/canvas-cli/commit/8d21bde17928492ee7c37cf222d1fc1ce5fe21f9))
|
|
18
|
+
|
|
5
19
|
## [0.3.1](https://github.com/groton-school/canvas-cli/compare/api/0.3.0...api/0.3.1) (2025-08-13)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -16,17 +16,6 @@ export type updatePathParameters = {
|
|
|
16
16
|
};
|
|
17
17
|
export type updateSearchParameters = Masquerade;
|
|
18
18
|
export type updateFormParameters = Masquerade & {
|
|
19
|
-
/** The assignment name. */
|
|
20
|
-
'assignment[name]': string;
|
|
21
|
-
/**
|
|
22
|
-
* The position of this assignment in the group when displaying assignment
|
|
23
|
-
* lists.
|
|
24
|
-
*
|
|
25
|
-
* Type: integer
|
|
26
|
-
*
|
|
27
|
-
* Format: 'int64'
|
|
28
|
-
*/
|
|
29
|
-
'assignment[position]': number | string;
|
|
30
19
|
/**
|
|
31
20
|
* Only applies if the assignment doesn't have student submissions.
|
|
32
21
|
*
|
|
@@ -44,6 +33,17 @@ export type updateFormParameters = Masquerade & {
|
|
|
44
33
|
* valid when the Kaltura plugin is enabled) "student_annotation"
|
|
45
34
|
*/
|
|
46
35
|
'assignment[submission_types]'?: ('online_quiz' | 'none' | 'on_paper' | 'discussion_topic' | 'external_tool' | 'online_upload' | 'online_text_entry' | 'online_url' | 'media_recording' | 'student_annotation')[];
|
|
36
|
+
/** The assignment name. */
|
|
37
|
+
'assignment[name]': string;
|
|
38
|
+
/**
|
|
39
|
+
* The position of this assignment in the group when displaying assignment
|
|
40
|
+
* lists.
|
|
41
|
+
*
|
|
42
|
+
* Type: integer
|
|
43
|
+
*
|
|
44
|
+
* Format: 'int64'
|
|
45
|
+
*/
|
|
46
|
+
'assignment[position]': number | string;
|
|
47
47
|
/**
|
|
48
48
|
* Allowed extensions if submission_types includes "online_upload"
|
|
49
49
|
*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Masquerade, Paginated } from '@groton/canvas-api.client.base';
|
|
2
|
+
import { Folder } from '../../../../../Resources/Files.js';
|
|
3
|
+
export type resolve_path_courses_full_pathPathParameters = {
|
|
4
|
+
/**
|
|
5
|
+
* ID
|
|
6
|
+
*
|
|
7
|
+
* Type: string
|
|
8
|
+
*/
|
|
9
|
+
course_id: string | number;
|
|
10
|
+
/** Full path to folder */
|
|
11
|
+
full_path: string;
|
|
12
|
+
};
|
|
13
|
+
export type resolve_path_courses_full_pathSearchParameters = Masquerade & Paginated;
|
|
14
|
+
type Options = {
|
|
15
|
+
pathParams: resolve_path_courses_full_pathPathParameters;
|
|
16
|
+
} & ({
|
|
17
|
+
searchParams?: Partial<resolve_path_courses_full_pathSearchParameters>;
|
|
18
|
+
strict?: false;
|
|
19
|
+
} | {
|
|
20
|
+
searchParams: resolve_path_courses_full_pathSearchParameters;
|
|
21
|
+
strict: true;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Resolve path
|
|
25
|
+
*
|
|
26
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
27
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
28
|
+
* The given path is relative to the context's root folder and does not include
|
|
29
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
30
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
31
|
+
* the given full path, a Not Found error is returned.
|
|
32
|
+
*
|
|
33
|
+
* Nickname: resolve_path_courses_full_path
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolve_path_courses_full_path(options: Options): Promise<Folder[]>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { client } from '../../../../../Client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve path
|
|
4
|
+
*
|
|
5
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
6
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
7
|
+
* The given path is relative to the context's root folder and does not include
|
|
8
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
9
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
10
|
+
* the given full path, a Not Found error is returned.
|
|
11
|
+
*
|
|
12
|
+
* Nickname: resolve_path_courses_full_path
|
|
13
|
+
*/
|
|
14
|
+
export async function resolve_path_courses_full_path(options) {
|
|
15
|
+
const response = await client().fetchAs(`/api/v1/courses/{course_id}/folders/by_path/{full_path}`, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
...options
|
|
18
|
+
});
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
@@ -22,15 +22,6 @@ export type uploadFormParameters = Masquerade & {
|
|
|
22
22
|
* a sub-folder.
|
|
23
23
|
*/
|
|
24
24
|
name: string;
|
|
25
|
-
/**
|
|
26
|
-
* How to handle duplicate filenames. If `overwrite`, then this file upload
|
|
27
|
-
* will overwrite any other file in the folder with the same name. If
|
|
28
|
-
* `rename`, then this file will be renamed if another file in the folder
|
|
29
|
-
* exists with the given name. If no parameter is given, the default is
|
|
30
|
-
* `overwrite`. This doesn't apply to file uploads in a context that doesn't
|
|
31
|
-
* have folders.
|
|
32
|
-
*/
|
|
33
|
-
on_duplicate?: 'overwrite' | 'rename';
|
|
34
25
|
/**
|
|
35
26
|
* The size of the file, in bytes. This field is recommended, as it will let
|
|
36
27
|
* you find out if there's a quota issue before uploading the raw file.
|
|
@@ -74,6 +65,15 @@ export type uploadFormParameters = Masquerade & {
|
|
|
74
65
|
* @deprecated Use parent_folder_path instead.
|
|
75
66
|
*/
|
|
76
67
|
folder?: string;
|
|
68
|
+
/**
|
|
69
|
+
* How to handle duplicate filenames. If `overwrite`, then this file upload
|
|
70
|
+
* will overwrite any other file in the folder with the same name. If
|
|
71
|
+
* `rename`, then this file will be renamed if another file in the folder
|
|
72
|
+
* exists with the given name. If no parameter is given, the default is
|
|
73
|
+
* `overwrite`. This doesn't apply to file uploads in a context that doesn't
|
|
74
|
+
* have folders.
|
|
75
|
+
*/
|
|
76
|
+
on_duplicate?: 'overwrite' | 'rename';
|
|
77
77
|
/**
|
|
78
78
|
* An array of additional information to include in the upload success
|
|
79
79
|
* response. See Files API for more information.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Masquerade, Paginated } from '@groton/canvas-api.client.base';
|
|
2
|
+
import { Folder } from '../../../../../Resources/Files.js';
|
|
3
|
+
export type resolve_path_groups_full_pathPathParameters = {
|
|
4
|
+
/**
|
|
5
|
+
* ID
|
|
6
|
+
*
|
|
7
|
+
* Type: string
|
|
8
|
+
*/
|
|
9
|
+
group_id: string | number;
|
|
10
|
+
/** Full path to folder */
|
|
11
|
+
full_path: string;
|
|
12
|
+
};
|
|
13
|
+
export type resolve_path_groups_full_pathSearchParameters = Masquerade & Paginated;
|
|
14
|
+
type Options = {
|
|
15
|
+
pathParams: resolve_path_groups_full_pathPathParameters;
|
|
16
|
+
} & ({
|
|
17
|
+
searchParams?: Partial<resolve_path_groups_full_pathSearchParameters>;
|
|
18
|
+
strict?: false;
|
|
19
|
+
} | {
|
|
20
|
+
searchParams: resolve_path_groups_full_pathSearchParameters;
|
|
21
|
+
strict: true;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Resolve path
|
|
25
|
+
*
|
|
26
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
27
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
28
|
+
* The given path is relative to the context's root folder and does not include
|
|
29
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
30
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
31
|
+
* the given full path, a Not Found error is returned.
|
|
32
|
+
*
|
|
33
|
+
* Nickname: resolve_path_groups_full_path
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolve_path_groups_full_path(options: Options): Promise<Folder[]>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { client } from '../../../../../Client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve path
|
|
4
|
+
*
|
|
5
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
6
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
7
|
+
* The given path is relative to the context's root folder and does not include
|
|
8
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
9
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
10
|
+
* the given full path, a Not Found error is returned.
|
|
11
|
+
*
|
|
12
|
+
* Nickname: resolve_path_groups_full_path
|
|
13
|
+
*/
|
|
14
|
+
export async function resolve_path_groups_full_path(options) {
|
|
15
|
+
const response = await client().fetchAs(`/api/v1/groups/{group_id}/folders/by_path/{full_path}`, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
...options
|
|
18
|
+
});
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Masquerade } from '@groton/canvas-api.client.base';
|
|
2
|
+
export type listPathParameters = {
|
|
3
|
+
/**
|
|
4
|
+
* ID
|
|
5
|
+
*
|
|
6
|
+
* Type: string
|
|
7
|
+
*/
|
|
8
|
+
id: string | number;
|
|
9
|
+
};
|
|
10
|
+
export type listSearchParameters = Masquerade;
|
|
11
|
+
type Options = {
|
|
12
|
+
pathParams: listPathParameters;
|
|
13
|
+
} & ({
|
|
14
|
+
searchParams?: Partial<listSearchParameters>;
|
|
15
|
+
strict?: false;
|
|
16
|
+
} | {
|
|
17
|
+
searchParams: listSearchParameters;
|
|
18
|
+
strict: true;
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Get custom colors
|
|
22
|
+
*
|
|
23
|
+
* Returns all custom colors that have been saved for a user.
|
|
24
|
+
*
|
|
25
|
+
* Nickname: get_custom_colors
|
|
26
|
+
*/
|
|
27
|
+
export declare function list(options: Options): Promise<void>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { client } from '../../../../Client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get custom colors
|
|
4
|
+
*
|
|
5
|
+
* Returns all custom colors that have been saved for a user.
|
|
6
|
+
*
|
|
7
|
+
* Nickname: get_custom_colors
|
|
8
|
+
*/
|
|
9
|
+
export async function list(options) {
|
|
10
|
+
const response = await client().fetchAs(`/api/v1/users/{id}/colors`, {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
...options
|
|
13
|
+
});
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Masquerade, Paginated } from '@groton/canvas-api.client.base';
|
|
2
|
+
import { Folder } from '../../../../../Resources/Files.js';
|
|
3
|
+
export type resolve_path_users_full_pathPathParameters = {
|
|
4
|
+
/**
|
|
5
|
+
* ID
|
|
6
|
+
*
|
|
7
|
+
* Type: string
|
|
8
|
+
*/
|
|
9
|
+
user_id: string | number;
|
|
10
|
+
/** Full path to folder */
|
|
11
|
+
full_path: string;
|
|
12
|
+
};
|
|
13
|
+
export type resolve_path_users_full_pathSearchParameters = Masquerade & Paginated;
|
|
14
|
+
type Options = {
|
|
15
|
+
pathParams: resolve_path_users_full_pathPathParameters;
|
|
16
|
+
} & ({
|
|
17
|
+
searchParams?: Partial<resolve_path_users_full_pathSearchParameters>;
|
|
18
|
+
strict?: false;
|
|
19
|
+
} | {
|
|
20
|
+
searchParams: resolve_path_users_full_pathSearchParameters;
|
|
21
|
+
strict: true;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Resolve path
|
|
25
|
+
*
|
|
26
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
27
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
28
|
+
* The given path is relative to the context's root folder and does not include
|
|
29
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
30
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
31
|
+
* the given full path, a Not Found error is returned.
|
|
32
|
+
*
|
|
33
|
+
* Nickname: resolve_path_users_full_path
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolve_path_users_full_path(options: Options): Promise<Folder[]>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { client } from '../../../../../Client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve path
|
|
4
|
+
*
|
|
5
|
+
* Given the full path to a folder, returns a list of all Folders in the path
|
|
6
|
+
* hierarchy, starting at the root folder, and ending at the requested folder.
|
|
7
|
+
* The given path is relative to the context's root folder and does not include
|
|
8
|
+
* the root folder's name (e.g., "course files"). If an empty path is given, the
|
|
9
|
+
* context's root folder alone is returned. Otherwise, if no folder exists with
|
|
10
|
+
* the given full path, a Not Found error is returned.
|
|
11
|
+
*
|
|
12
|
+
* Nickname: resolve_path_users_full_path
|
|
13
|
+
*/
|
|
14
|
+
export async function resolve_path_users_full_path(options) {
|
|
15
|
+
const response = await client().fetchAs(`/api/v1/users/{user_id}/folders/by_path/{full_path}`, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
...options
|
|
18
|
+
});
|
|
19
|
+
return response;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groton/canvas-api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Typed access to Canvas LMS API with embedded documentation",
|
|
5
5
|
"homepage": "https://github.com/groton-school/canvas-cli/tree/main/packages/api/canvas-api#readme",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"del-cli": "^6.0.0",
|
|
29
29
|
"npm-run-all": "^4.1.5",
|
|
30
30
|
"typescript": "~5.8.3",
|
|
31
|
-
"@groton/canvas-api.swagger-renderer": "0.1.
|
|
31
|
+
"@groton/canvas-api.swagger-renderer": "0.1.2"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"clean": "run-s clean:*",
|