@verdocs/js-sdk 3.6.11 → 3.6.12

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.
@@ -114,3 +114,23 @@ export declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: strin
114
114
  * ```
115
115
  */
116
116
  export declare const deleteProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
117
+ export interface ICreateBusinessAccountRequest {
118
+ orgName: string;
119
+ email: string;
120
+ password: string;
121
+ firstName: string;
122
+ lastName: string;
123
+ }
124
+ /**
125
+ * Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an
126
+ * existing organization should be invited, and follow their invitation links/instructions to create their accounts.
127
+ *
128
+ * ```typescript
129
+ * import {Profiles} from '@verdocs/js-sdk/Users';
130
+ *
131
+ * const newAccount = await Profiles.createBusinessAccount({
132
+ * orgName: 'ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'
133
+ * });
134
+ * ```
135
+ */
136
+ export declare const createBusinessAccount: (endpoint: VerdocsEndpoint, params: ICreateBusinessAccountRequest) => Promise<IProfile>;
package/Users/Profiles.js CHANGED
@@ -155,3 +155,20 @@ export var deleteProfile = function (endpoint, profileId) {
155
155
  .delete("/profiles/".concat(profileId))
156
156
  .then(function (r) { return r.data; });
157
157
  };
158
+ /**
159
+ * Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an
160
+ * existing organization should be invited, and follow their invitation links/instructions to create their accounts.
161
+ *
162
+ * ```typescript
163
+ * import {Profiles} from '@verdocs/js-sdk/Users';
164
+ *
165
+ * const newAccount = await Profiles.createBusinessAccount({
166
+ * orgName: 'ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'
167
+ * });
168
+ * ```
169
+ */
170
+ export var createBusinessAccount = function (endpoint, params) {
171
+ return endpoint.api //
172
+ .post('/user/business', params)
173
+ .then(function (r) { return r.data; });
174
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.6.11",
3
+ "version": "3.6.12",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",