@devopness/sdk-js 2.36.0 → 2.37.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.
@@ -13,6 +13,7 @@ import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { SocialAccount } from '../../generated/models';
15
15
  import { SocialAccountCreate } from '../../generated/models';
16
+ import { SocialAccountRelation } from '../../generated/models';
16
17
  import { SocialAccountStatus } from '../../generated/models';
17
18
  /**
18
19
  * SocialAccountsApiService - Auto-generated
@@ -20,33 +21,33 @@ import { SocialAccountStatus } from '../../generated/models';
20
21
  export declare class SocialAccountsApiService extends ApiBaseService {
21
22
  /**
22
23
  *
23
- * @summary Create a new social account linked to the current user\'s profile
24
- * @param {SocialAccountCreate} socialAccountCreate A JSON object containing social provider callback data
24
+ * @summary Add a social account
25
+ * @param {SocialAccountCreate} socialAccountCreate A JSON object containing the resource data
25
26
  */
26
27
  addSocialAccount(socialAccountCreate: SocialAccountCreate): Promise<ApiResponse<SocialAccount>>;
27
28
  /**
28
29
  *
29
30
  * @summary Delete a given social account
30
- * @param {number} socialAccountId The Id of the social account to be deleted
31
+ * @param {number} socialAccountId The ID of the social account.
31
32
  */
32
33
  deleteSocialAccount(socialAccountId: number): Promise<ApiResponse<void>>;
33
34
  /**
34
35
  *
35
- * @summary Get details of a single Social authentication provider
36
- * @param {number} socialAccountId Unique ID of the provider to be retrieved
36
+ * @summary Get a social account by provider name
37
+ * @param {string} provider The provider name.
37
38
  */
38
- getSocialAccount(socialAccountId: number): Promise<ApiResponse<SocialAccount>>;
39
+ getSocialAccount(provider: string): Promise<ApiResponse<SocialAccount>>;
39
40
  /**
40
41
  *
41
- * @summary Get the connect status of a Social authentication provider, by its name
42
- * @param {string} socialAccountProviderName Unique name of the provider to be retrieved
42
+ * @summary Get status of a social account
43
+ * @param {string} provider The provider name.
43
44
  */
44
- getSocialAccountStatusByName(socialAccountProviderName: string): Promise<ApiResponse<SocialAccountStatus>>;
45
+ getSocialAccountStatus(provider: string): Promise<ApiResponse<SocialAccountStatus>>;
45
46
  /**
46
47
  *
47
- * @summary Return a list of all social accounts belonging to current user
48
+ * @summary Return a list of all social accounts of the current user
48
49
  * @param {number} [page] Number of the page to be retrieved
49
50
  * @param {number} [perPage] Number of items returned per page
50
51
  */
51
- listSocialAccounts(page?: number, perPage?: number): Promise<ApiResponse<Array<SocialAccount>>>;
52
+ listSocialAccounts(page?: number, perPage?: number): Promise<ApiResponse<Array<SocialAccountRelation>>>;
52
53
  }
@@ -31,8 +31,8 @@ const Exceptions_1 = require("../../../common/Exceptions");
31
31
  class SocialAccountsApiService extends ApiBaseService_1.ApiBaseService {
32
32
  /**
33
33
  *
34
- * @summary Create a new social account linked to the current user\'s profile
35
- * @param {SocialAccountCreate} socialAccountCreate A JSON object containing social provider callback data
34
+ * @summary Add a social account
35
+ * @param {SocialAccountCreate} socialAccountCreate A JSON object containing the resource data
36
36
  */
37
37
  addSocialAccount(socialAccountCreate) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
@@ -48,7 +48,7 @@ class SocialAccountsApiService extends ApiBaseService_1.ApiBaseService {
48
48
  /**
49
49
  *
50
50
  * @summary Delete a given social account
51
- * @param {number} socialAccountId The Id of the social account to be deleted
51
+ * @param {number} socialAccountId The ID of the social account.
52
52
  */
53
53
  deleteSocialAccount(socialAccountId) {
54
54
  return __awaiter(this, void 0, void 0, function* () {
@@ -63,39 +63,39 @@ class SocialAccountsApiService extends ApiBaseService_1.ApiBaseService {
63
63
  }
64
64
  /**
65
65
  *
66
- * @summary Get details of a single Social authentication provider
67
- * @param {number} socialAccountId Unique ID of the provider to be retrieved
66
+ * @summary Get a social account by provider name
67
+ * @param {string} provider The provider name.
68
68
  */
69
- getSocialAccount(socialAccountId) {
69
+ getSocialAccount(provider) {
70
70
  return __awaiter(this, void 0, void 0, function* () {
71
- if (socialAccountId === null || socialAccountId === undefined) {
72
- throw new Exceptions_1.ArgumentNullException('socialAccountId', 'getSocialAccount');
71
+ if (provider === null || provider === undefined) {
72
+ throw new Exceptions_1.ArgumentNullException('provider', 'getSocialAccount');
73
73
  }
74
74
  let queryString = '';
75
- const requestUrl = '/social-accounts/{social_account_id}' + (queryString ? `?${queryString}` : '');
76
- const response = yield this.get(requestUrl.replace(`{${"social_account_id"}}`, encodeURIComponent(String(socialAccountId))));
75
+ const requestUrl = '/social-accounts/{provider}' + (queryString ? `?${queryString}` : '');
76
+ const response = yield this.get(requestUrl.replace(`{${"provider"}}`, encodeURIComponent(String(provider))));
77
77
  return new ApiResponse_1.ApiResponse(response);
78
78
  });
79
79
  }
80
80
  /**
81
81
  *
82
- * @summary Get the connect status of a Social authentication provider, by its name
83
- * @param {string} socialAccountProviderName Unique name of the provider to be retrieved
82
+ * @summary Get status of a social account
83
+ * @param {string} provider The provider name.
84
84
  */
85
- getSocialAccountStatusByName(socialAccountProviderName) {
85
+ getSocialAccountStatus(provider) {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
- if (socialAccountProviderName === null || socialAccountProviderName === undefined) {
88
- throw new Exceptions_1.ArgumentNullException('socialAccountProviderName', 'getSocialAccountStatusByName');
87
+ if (provider === null || provider === undefined) {
88
+ throw new Exceptions_1.ArgumentNullException('provider', 'getSocialAccountStatus');
89
89
  }
90
90
  let queryString = '';
91
- const requestUrl = '/social-accounts/{social_account_provider_name}/status' + (queryString ? `?${queryString}` : '');
92
- const response = yield this.get(requestUrl.replace(`{${"social_account_provider_name"}}`, encodeURIComponent(String(socialAccountProviderName))));
91
+ const requestUrl = '/social-accounts/{provider}/status' + (queryString ? `?${queryString}` : '');
92
+ const response = yield this.get(requestUrl.replace(`{${"provider"}}`, encodeURIComponent(String(provider))));
93
93
  return new ApiResponse_1.ApiResponse(response);
94
94
  });
95
95
  }
96
96
  /**
97
97
  *
98
- * @summary Return a list of all social accounts belonging to current user
98
+ * @summary Return a list of all social accounts of the current user
99
99
  * @param {number} [page] Number of the page to be retrieved
100
100
  * @param {number} [perPage] Number of items returned per page
101
101
  */
@@ -175,6 +175,7 @@ export * from './social-account';
175
175
  export * from './social-account-create';
176
176
  export * from './social-account-displayable-name';
177
177
  export * from './social-account-provider';
178
+ export * from './social-account-relation';
178
179
  export * from './social-account-status';
179
180
  export * from './source-provider';
180
181
  export * from './source-provider-create';
@@ -191,6 +191,7 @@ __exportStar(require("./social-account"), exports);
191
191
  __exportStar(require("./social-account-create"), exports);
192
192
  __exportStar(require("./social-account-displayable-name"), exports);
193
193
  __exportStar(require("./social-account-provider"), exports);
194
+ __exportStar(require("./social-account-relation"), exports);
194
195
  __exportStar(require("./social-account-status"), exports);
195
196
  __exportStar(require("./source-provider"), exports);
196
197
  __exportStar(require("./source-provider-create"), exports);
@@ -42,6 +42,12 @@ export interface RelatedAction {
42
42
  * @memberof RelatedAction
43
43
  */
44
44
  type_human_readable: string;
45
+ /**
46
+ * The name of the resource
47
+ * @type {string}
48
+ * @memberof RelatedAction
49
+ */
50
+ resource_name?: string;
45
51
  /**
46
52
  *
47
53
  * @type {ResourceType}
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { SocialAccountProvider } from './social-account-provider';
12
+ import { SourceProviderName } from './source-provider-name';
13
13
  /**
14
14
  *
15
15
  * @export
@@ -18,12 +18,12 @@ import { SocialAccountProvider } from './social-account-provider';
18
18
  export interface SocialAccountCreate {
19
19
  /**
20
20
  *
21
- * @type {SocialAccountProvider}
21
+ * @type {SourceProviderName}
22
22
  * @memberof SocialAccountCreate
23
23
  */
24
- provider: SocialAccountProvider;
24
+ provider: SourceProviderName;
25
25
  /**
26
- * The temporary code forwarded by the OAuth provider as a parameter to our callback URL
26
+ * The temporary code forwarded by the OAuth provider as a parameter to our callback URL. Must be at least 8 characters.
27
27
  * @type {string}
28
28
  * @memberof SocialAccountCreate
29
29
  */
@@ -19,6 +19,5 @@ export declare enum SocialAccountDisplayableName {
19
19
  Facebook = "Facebook",
20
20
  GitHub = "GitHub",
21
21
  GitLab = "GitLab",
22
- Google = "Google",
23
- LinkedIn = "LinkedIn"
22
+ Google = "Google"
24
23
  }
@@ -25,5 +25,4 @@ var SocialAccountDisplayableName;
25
25
  SocialAccountDisplayableName["GitHub"] = "GitHub";
26
26
  SocialAccountDisplayableName["GitLab"] = "GitLab";
27
27
  SocialAccountDisplayableName["Google"] = "Google";
28
- SocialAccountDisplayableName["LinkedIn"] = "LinkedIn";
29
28
  })(SocialAccountDisplayableName = exports.SocialAccountDisplayableName || (exports.SocialAccountDisplayableName = {}));
@@ -19,6 +19,5 @@ export declare enum SocialAccountProvider {
19
19
  Facebook = "facebook",
20
20
  Github = "github",
21
21
  Gitlab = "gitlab",
22
- Google = "google",
23
- Linkedin = "linkedin"
22
+ Google = "google"
24
23
  }
@@ -25,5 +25,4 @@ var SocialAccountProvider;
25
25
  SocialAccountProvider["Github"] = "github";
26
26
  SocialAccountProvider["Gitlab"] = "gitlab";
27
27
  SocialAccountProvider["Google"] = "google";
28
- SocialAccountProvider["Linkedin"] = "linkedin";
29
28
  })(SocialAccountProvider = exports.SocialAccountProvider || (exports.SocialAccountProvider = {}));
@@ -0,0 +1,74 @@
1
+ /**
2
+ * devopness API
3
+ * Devopness API - Painless essential DevOps to everyone
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { SocialAccountDisplayableName } from './social-account-displayable-name';
13
+ import { SocialAccountProvider } from './social-account-provider';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface SocialAccountRelation
18
+ */
19
+ export interface SocialAccountRelation {
20
+ /**
21
+ * The ID of the given social account
22
+ * @type {number}
23
+ * @memberof SocialAccountRelation
24
+ */
25
+ id: number;
26
+ /**
27
+ * The current user\'s ID
28
+ * @type {number}
29
+ * @memberof SocialAccountRelation
30
+ */
31
+ user_id: number;
32
+ /**
33
+ *
34
+ * @type {SocialAccountProvider}
35
+ * @memberof SocialAccountRelation
36
+ */
37
+ provider: SocialAccountProvider;
38
+ /**
39
+ *
40
+ * @type {SocialAccountDisplayableName}
41
+ * @memberof SocialAccountRelation
42
+ */
43
+ provider_human_readable: SocialAccountDisplayableName;
44
+ /**
45
+ * The nickname of the user on the Source Authentication provider
46
+ * @type {string}
47
+ * @memberof SocialAccountRelation
48
+ */
49
+ provider_user_nickname: string;
50
+ /**
51
+ * If this social account is from a Version Control System (VCS)
52
+ * @type {boolean}
53
+ * @memberof SocialAccountRelation
54
+ */
55
+ is_vcs: boolean;
56
+ /**
57
+ * The date and time indicating when the authentication token will expire at
58
+ * @type {string}
59
+ * @memberof SocialAccountRelation
60
+ */
61
+ token_expires_at: string | null;
62
+ /**
63
+ * The date and time when the record was created
64
+ * @type {string}
65
+ * @memberof SocialAccountRelation
66
+ */
67
+ created_at: string;
68
+ /**
69
+ * The date and time when the record was last updated
70
+ * @type {string}
71
+ * @memberof SocialAccountRelation
72
+ */
73
+ updated_at: string;
74
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /**
4
+ * devopness API
5
+ * Devopness API - Painless essential DevOps to everyone
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,7 +9,6 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { SocialAccountProvider } from './social-account-provider';
13
12
  /**
14
13
  *
15
14
  * @export
@@ -17,21 +16,21 @@ import { SocialAccountProvider } from './social-account-provider';
17
16
  */
18
17
  export interface SocialAccountStatus {
19
18
  /**
20
- *
21
- * @type {SocialAccountProvider}
19
+ * Name of the provider
20
+ * @type {string}
22
21
  * @memberof SocialAccountStatus
23
22
  */
24
- provider?: SocialAccountProvider;
23
+ provider: string;
25
24
  /**
26
- * Tells if the provider is already connected to the current user\'s account
25
+ * If the account is currently connected
27
26
  * @type {boolean}
28
27
  * @memberof SocialAccountStatus
29
28
  */
30
- connected?: boolean;
29
+ connected: boolean;
31
30
  /**
32
- * A URL path to the provider\'s OAuth page
31
+ * URL of the connection
33
32
  * @type {string}
34
33
  * @memberof SocialAccountStatus
35
34
  */
36
- connect_url?: string;
35
+ connect_url: string;
37
36
  }
@@ -18,11 +18,17 @@ import { SocialAccountProvider } from './social-account-provider';
18
18
  */
19
19
  export interface SocialAccount {
20
20
  /**
21
- * The unique id of the given record
21
+ * The ID of the given social account
22
22
  * @type {number}
23
23
  * @memberof SocialAccount
24
24
  */
25
25
  id: number;
26
+ /**
27
+ * The current user\'s ID
28
+ * @type {number}
29
+ * @memberof SocialAccount
30
+ */
31
+ user_id: number;
26
32
  /**
27
33
  *
28
34
  * @type {SocialAccountProvider}
@@ -34,35 +40,35 @@ export interface SocialAccount {
34
40
  * @type {SocialAccountDisplayableName}
35
41
  * @memberof SocialAccount
36
42
  */
37
- provider_human_readable?: SocialAccountDisplayableName;
43
+ provider_human_readable: SocialAccountDisplayableName;
38
44
  /**
39
- * The nickname of the user on the Social Authentication provider
45
+ * The nickname of the user on the Source Authentication provider
40
46
  * @type {string}
41
47
  * @memberof SocialAccount
42
48
  */
43
49
  provider_user_nickname: string;
44
50
  /**
45
- * Tells if the social account provider is a Source Code Provider/Version Control System. e.g. false for Facebook, true for Github
51
+ * If this social account is from a Version Control System (VCS)
46
52
  * @type {boolean}
47
53
  * @memberof SocialAccount
48
54
  */
49
- is_vcs?: boolean;
55
+ is_vcs: boolean;
50
56
  /**
51
- * The current user\'s id
52
- * @type {number}
57
+ * The date and time indicating when the authentication token will expire at
58
+ * @type {string}
53
59
  * @memberof SocialAccount
54
60
  */
55
- user_id?: number;
61
+ token_expires_at: string | null;
56
62
  /**
57
63
  * The date and time when the record was created
58
64
  * @type {string}
59
65
  * @memberof SocialAccount
60
66
  */
61
- created_at?: string;
67
+ created_at: string;
62
68
  /**
63
69
  * The date and time when the record was last updated
64
70
  * @type {string}
65
71
  * @memberof SocialAccount
66
72
  */
67
- updated_at?: string;
73
+ updated_at: string;
68
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.36.0",
3
+ "version": "2.37.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },