@verdocs/js-sdk 2.0.8 → 2.0.9

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.
@@ -18,7 +18,17 @@ import { VerdocsEndpoint } from '../VerdocsEndpoint';
18
18
  * const groups = await Groups.getGroups(ORGID);
19
19
  * ```
20
20
  */
21
- export declare const getGroups: (endpoint: VerdocsEndpoint, organizationId: string, name?: string) => Promise<IGroup[]>;
21
+ export declare const getGroups: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IGroup[]>;
22
+ /**
23
+ * Get a single group by name. Returns a detail record.
24
+ *
25
+ * ```typescript
26
+ * import {Groups} from '@verdocs/js-sdk/Organizations';
27
+ *
28
+ * const groups = await Groups.getGroups(ORGID);
29
+ * ```
30
+ */
31
+ export declare const getGroupByName: (endpoint: VerdocsEndpoint, organizationId: string, name?: string) => Promise<IGroup>;
22
32
  /**
23
33
  * Get the details for a group.
24
34
  *
@@ -16,7 +16,21 @@
16
16
  * const groups = await Groups.getGroups(ORGID);
17
17
  * ```
18
18
  */
19
- export var getGroups = function (endpoint, organizationId, name) {
19
+ export var getGroups = function (endpoint, organizationId) {
20
+ return endpoint.api //
21
+ .get("/organizations/".concat(organizationId, "/groups"))
22
+ .then(function (r) { return r.data; });
23
+ };
24
+ /**
25
+ * Get a single group by name. Returns a detail record.
26
+ *
27
+ * ```typescript
28
+ * import {Groups} from '@verdocs/js-sdk/Organizations';
29
+ *
30
+ * const groups = await Groups.getGroups(ORGID);
31
+ * ```
32
+ */
33
+ export var getGroupByName = function (endpoint, organizationId, name) {
20
34
  return endpoint.api //
21
35
  .get("/organizations/".concat(organizationId, "/groups"), { params: { name: name } })
22
36
  .then(function (r) { return r.data; });
@@ -41,6 +41,8 @@ export interface IGroup {
41
41
  name: string;
42
42
  organization_id: string;
43
43
  /** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
44
+ parent: IGroup | null;
45
+ /** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
44
46
  parent_id: string | null;
45
47
  /** Some operations will additionally return a list of permissions. */
46
48
  permissions?: TPermission[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",