@gambulls-org/gambulls-apis 3.0.274 → 3.0.275

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.
Files changed (87) hide show
  1. package/.idea/gambulls-apis.iml +11 -11
  2. package/.idea/modules.xml +7 -7
  3. package/.idea/vcs.xml +5 -5
  4. package/.openapi-generator/FILES +549 -543
  5. package/.openapi-generator-ignore +23 -23
  6. package/README.md +16 -16
  7. package/api.ts +10356 -10356
  8. package/apis/AdminAffiliateApi.js +7 -17
  9. package/apis/AdminAppConfigApi.js +7 -17
  10. package/apis/AdminAuthApi.js +7 -17
  11. package/apis/AdminBannerApi.js +7 -17
  12. package/apis/AdminBonusApi.js +7 -17
  13. package/apis/AdminCategoryApi.js +7 -17
  14. package/apis/AdminChatApi.js +7 -17
  15. package/apis/AdminDashboardApi.js +7 -17
  16. package/apis/AdminExchangeApi.js +7 -17
  17. package/apis/AdminFileManagementApi.js +7 -17
  18. package/apis/AdminGamesApi.js +7 -17
  19. package/apis/AdminGroupApi.js +7 -17
  20. package/apis/AdminLoyaltyApi.js +7 -17
  21. package/apis/AdminManagementApi.js +7 -17
  22. package/apis/AdminMenuApi.js +7 -17
  23. package/apis/AdminPaymentSystemApi.js +7 -17
  24. package/apis/AdminPinnedMessageApi.js +7 -17
  25. package/apis/AdminPolicyApi.js +7 -17
  26. package/apis/AdminProvidersApi.js +7 -17
  27. package/apis/AdminRakebackEventApi.js +7 -17
  28. package/apis/AdminReportApi.js +7 -17
  29. package/apis/AdminSportApi.js +164 -0
  30. package/apis/AdminSportApi.ts +176 -0
  31. package/apis/AdminUserManagementApi.js +7 -17
  32. package/apis/AuthApi.js +7 -17
  33. package/apis/CMSApi.js +7 -17
  34. package/apis/CronDataCleanupApi.js +7 -17
  35. package/apis/HealthCheckApi.js +7 -17
  36. package/apis/PublicBannerApi.js +7 -17
  37. package/apis/PublicGamesApi.js +8 -17
  38. package/apis/PublicGamesApi.ts +1 -0
  39. package/apis/PublicPolicyApi.js +7 -17
  40. package/apis/RGSApi.js +7 -17
  41. package/apis/RGSV2Api.js +7 -17
  42. package/apis/SportsbookApi.js +7 -17
  43. package/apis/TatumApi.js +7 -17
  44. package/apis/TestForNonProductionOnlyApi.js +7 -17
  45. package/apis/UserAffiliateApi.js +7 -17
  46. package/apis/UserAvatarApi.js +7 -17
  47. package/apis/UserBalanceApi.js +7 -17
  48. package/apis/UserBonusApi.js +7 -17
  49. package/apis/UserDepositApi.js +7 -17
  50. package/apis/UserDocumentApi.js +7 -17
  51. package/apis/UserGamesApi.js +7 -17
  52. package/apis/UserLoyaltyApi.js +7 -17
  53. package/apis/UserModeratorApi.js +7 -17
  54. package/apis/UserNotificationApi.js +7 -17
  55. package/apis/UserPreferencesApi.js +7 -17
  56. package/apis/UserProfileApi.js +7 -17
  57. package/apis/UserResponsibleGamingApi.js +7 -17
  58. package/apis/UserSportsbookApi.js +7 -17
  59. package/apis/UserStatisticApi.js +7 -17
  60. package/apis/UserTippingApi.js +7 -17
  61. package/apis/UserTransactionHistoryApi.js +7 -17
  62. package/apis/UserUploadApi.js +7 -17
  63. package/apis/UserWagerApi.js +7 -17
  64. package/apis/UserWithdrawalApi.js +7 -17
  65. package/apis/index.js +1 -0
  66. package/apis/index.ts +1 -0
  67. package/base.ts +86 -86
  68. package/common.ts +150 -150
  69. package/configuration.ts +110 -110
  70. package/git_push.sh +57 -57
  71. package/hooks.json +8 -8
  72. package/models/ApiAdminSportsGet200Response.js +61 -0
  73. package/models/ApiAdminSportsGet200Response.ts +100 -0
  74. package/models/ApiAdminSportsGet200ResponseResponseObject.js +67 -0
  75. package/models/ApiAdminSportsGet200ResponseResponseObject.ts +110 -0
  76. package/models/ApiAdminSportsGet200ResponseResponseObjectItemsInner.js +82 -0
  77. package/models/ApiAdminSportsGet200ResponseResponseObjectItemsInner.ts +138 -0
  78. package/models/ApiAdminSportsIdPatch200Response.js +61 -0
  79. package/models/ApiAdminSportsIdPatch200Response.ts +100 -0
  80. package/models/ApiAdminSportsIdPatchRequest.js +50 -0
  81. package/models/ApiAdminSportsIdPatchRequest.ts +73 -0
  82. package/models/index.js +5 -0
  83. package/models/index.ts +5 -0
  84. package/openapitools.json +7 -7
  85. package/package.json +26 -26
  86. package/tsconfig.json +108 -108
  87. package/workflow.sh +40 -40
package/common.ts CHANGED
@@ -1,150 +1,150 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Swagger API
5
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- *
7
- * The version of the OpenAPI document: 1.0.0
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
-
15
-
16
- import type { Configuration } from "./configuration";
17
- import type { RequestArgs } from "./base";
18
- import type { AxiosInstance, AxiosResponse } from 'axios';
19
- import { RequiredError } from "./base";
20
-
21
- /**
22
- *
23
- * @export
24
- */
25
- export const DUMMY_BASE_URL = 'https://example.com'
26
-
27
- /**
28
- *
29
- * @throws {RequiredError}
30
- * @export
31
- */
32
- export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
- if (paramValue === null || paramValue === undefined) {
34
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
- }
36
- }
37
-
38
- /**
39
- *
40
- * @export
41
- */
42
- export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
- if (configuration && configuration.apiKey) {
44
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
- ? await configuration.apiKey(keyParamName)
46
- : await configuration.apiKey;
47
- object[keyParamName] = localVarApiKeyValue;
48
- }
49
- }
50
-
51
- /**
52
- *
53
- * @export
54
- */
55
- export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
- if (configuration && (configuration.username || configuration.password)) {
57
- object["auth"] = { username: configuration.username, password: configuration.password };
58
- }
59
- }
60
-
61
- /**
62
- *
63
- * @export
64
- */
65
- export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
- if (configuration && configuration.accessToken) {
67
- const accessToken = typeof configuration.accessToken === 'function'
68
- ? await configuration.accessToken()
69
- : await configuration.accessToken;
70
- object["Authorization"] = "Bearer " + accessToken;
71
- }
72
- }
73
-
74
- /**
75
- *
76
- * @export
77
- */
78
- export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
- if (configuration && configuration.accessToken) {
80
- const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
- ? await configuration.accessToken(name, scopes)
82
- : await configuration.accessToken;
83
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
- }
85
- }
86
-
87
- function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
- if (parameter == null) return;
89
- if (typeof parameter === "object") {
90
- if (Array.isArray(parameter)) {
91
- (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
92
- }
93
- else {
94
- Object.keys(parameter).forEach(currentKey =>
95
- setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
- );
97
- }
98
- }
99
- else {
100
- if (urlSearchParams.has(key)) {
101
- urlSearchParams.append(key, parameter);
102
- }
103
- else {
104
- urlSearchParams.set(key, parameter);
105
- }
106
- }
107
- }
108
-
109
- /**
110
- *
111
- * @export
112
- */
113
- export const setSearchParams = function (url: URL, ...objects: any[]) {
114
- const searchParams = new URLSearchParams(url.search);
115
- setFlattenedQueryParams(searchParams, objects);
116
- url.search = searchParams.toString();
117
- }
118
-
119
- /**
120
- *
121
- * @export
122
- */
123
- export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
- const nonString = typeof value !== 'string';
125
- const needsSerialization = nonString && configuration && configuration.isJsonMime
126
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
- : nonString;
128
- return needsSerialization
129
- ? JSON.stringify(value !== undefined ? value : {})
130
- : (value || "");
131
- }
132
-
133
- /**
134
- *
135
- * @export
136
- */
137
- export const toPathString = function (url: URL) {
138
- return url.pathname + url.search + url.hash
139
- }
140
-
141
- /**
142
- *
143
- * @export
144
- */
145
- export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
- return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
- const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
- return axios.request<T, R>(axiosRequestArgs);
149
- };
150
- }
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Swagger API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
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
+
15
+
16
+ import type { Configuration } from "./configuration";
17
+ import type { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = searchParams.toString();
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }
package/configuration.ts CHANGED
@@ -1,110 +1,110 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Swagger API
5
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- *
7
- * The version of the OpenAPI document: 1.0.0
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
-
15
-
16
- export interface ConfigurationParameters {
17
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
18
- username?: string;
19
- password?: string;
20
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
21
- basePath?: string;
22
- serverIndex?: number;
23
- baseOptions?: any;
24
- formDataCtor?: new () => any;
25
- }
26
-
27
- export class Configuration {
28
- /**
29
- * parameter for apiKey security
30
- * @param name security name
31
- * @memberof Configuration
32
- */
33
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
34
- /**
35
- * parameter for basic security
36
- *
37
- * @type {string}
38
- * @memberof Configuration
39
- */
40
- username?: string;
41
- /**
42
- * parameter for basic security
43
- *
44
- * @type {string}
45
- * @memberof Configuration
46
- */
47
- password?: string;
48
- /**
49
- * parameter for oauth2 security
50
- * @param name security name
51
- * @param scopes oauth2 scope
52
- * @memberof Configuration
53
- */
54
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
55
- /**
56
- * override base path
57
- *
58
- * @type {string}
59
- * @memberof Configuration
60
- */
61
- basePath?: string;
62
- /**
63
- * override server index
64
- *
65
- * @type {number}
66
- * @memberof Configuration
67
- */
68
- serverIndex?: number;
69
- /**
70
- * base options for axios calls
71
- *
72
- * @type {any}
73
- * @memberof Configuration
74
- */
75
- baseOptions?: any;
76
- /**
77
- * The FormData constructor that will be used to create multipart form data
78
- * requests. You can inject this here so that execution environments that
79
- * do not support the FormData class can still run the generated client.
80
- *
81
- * @type {new () => FormData}
82
- */
83
- formDataCtor?: new () => any;
84
-
85
- constructor(param: ConfigurationParameters = {}) {
86
- this.apiKey = param.apiKey;
87
- this.username = param.username;
88
- this.password = param.password;
89
- this.accessToken = param.accessToken;
90
- this.basePath = param.basePath;
91
- this.serverIndex = param.serverIndex;
92
- this.baseOptions = param.baseOptions;
93
- this.formDataCtor = param.formDataCtor;
94
- }
95
-
96
- /**
97
- * Check if the given MIME is a JSON MIME.
98
- * JSON MIME examples:
99
- * application/json
100
- * application/json; charset=UTF8
101
- * APPLICATION/JSON
102
- * application/vnd.company+json
103
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
104
- * @return True if the given MIME is JSON, false otherwise.
105
- */
106
- public isJsonMime(mime: string): boolean {
107
- const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
108
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
109
- }
110
- }
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Swagger API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
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
+
15
+
16
+ export interface ConfigurationParameters {
17
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
18
+ username?: string;
19
+ password?: string;
20
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
21
+ basePath?: string;
22
+ serverIndex?: number;
23
+ baseOptions?: any;
24
+ formDataCtor?: new () => any;
25
+ }
26
+
27
+ export class Configuration {
28
+ /**
29
+ * parameter for apiKey security
30
+ * @param name security name
31
+ * @memberof Configuration
32
+ */
33
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
34
+ /**
35
+ * parameter for basic security
36
+ *
37
+ * @type {string}
38
+ * @memberof Configuration
39
+ */
40
+ username?: string;
41
+ /**
42
+ * parameter for basic security
43
+ *
44
+ * @type {string}
45
+ * @memberof Configuration
46
+ */
47
+ password?: string;
48
+ /**
49
+ * parameter for oauth2 security
50
+ * @param name security name
51
+ * @param scopes oauth2 scope
52
+ * @memberof Configuration
53
+ */
54
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
55
+ /**
56
+ * override base path
57
+ *
58
+ * @type {string}
59
+ * @memberof Configuration
60
+ */
61
+ basePath?: string;
62
+ /**
63
+ * override server index
64
+ *
65
+ * @type {number}
66
+ * @memberof Configuration
67
+ */
68
+ serverIndex?: number;
69
+ /**
70
+ * base options for axios calls
71
+ *
72
+ * @type {any}
73
+ * @memberof Configuration
74
+ */
75
+ baseOptions?: any;
76
+ /**
77
+ * The FormData constructor that will be used to create multipart form data
78
+ * requests. You can inject this here so that execution environments that
79
+ * do not support the FormData class can still run the generated client.
80
+ *
81
+ * @type {new () => FormData}
82
+ */
83
+ formDataCtor?: new () => any;
84
+
85
+ constructor(param: ConfigurationParameters = {}) {
86
+ this.apiKey = param.apiKey;
87
+ this.username = param.username;
88
+ this.password = param.password;
89
+ this.accessToken = param.accessToken;
90
+ this.basePath = param.basePath;
91
+ this.serverIndex = param.serverIndex;
92
+ this.baseOptions = param.baseOptions;
93
+ this.formDataCtor = param.formDataCtor;
94
+ }
95
+
96
+ /**
97
+ * Check if the given MIME is a JSON MIME.
98
+ * JSON MIME examples:
99
+ * application/json
100
+ * application/json; charset=UTF8
101
+ * APPLICATION/JSON
102
+ * application/vnd.company+json
103
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
104
+ * @return True if the given MIME is JSON, false otherwise.
105
+ */
106
+ public isJsonMime(mime: string): boolean {
107
+ const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
108
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
109
+ }
110
+ }
package/git_push.sh CHANGED
@@ -1,57 +1,57 @@
1
- #!/bin/sh
2
- # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
- #
4
- # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
-
6
- git_user_id=$1
7
- git_repo_id=$2
8
- release_note=$3
9
- git_host=$4
10
-
11
- if [ "$git_host" = "" ]; then
12
- git_host="github.com"
13
- echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
- fi
15
-
16
- if [ "$git_user_id" = "" ]; then
17
- git_user_id="GIT_USER_ID"
18
- echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
- fi
20
-
21
- if [ "$git_repo_id" = "" ]; then
22
- git_repo_id="GIT_REPO_ID"
23
- echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
- fi
25
-
26
- if [ "$release_note" = "" ]; then
27
- release_note="Minor update"
28
- echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
- fi
30
-
31
- # Initialize the local directory as a Git repository
32
- git init
33
-
34
- # Adds the files in the local repository and stages them for commit.
35
- git add .
36
-
37
- # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
- git commit -m "$release_note"
39
-
40
- # Sets the new remote
41
- git_remote=$(git remote)
42
- if [ "$git_remote" = "" ]; then # git remote not defined
43
-
44
- if [ "$GIT_TOKEN" = "" ]; then
45
- echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
- git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
- else
48
- git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
- fi
50
-
51
- fi
52
-
53
- git pull origin master
54
-
55
- # Pushes (Forces) the changes in the local repository up to the remote repository
56
- echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
- git push origin master 2>&1 | grep -v 'To https'
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+ git_host=$4
10
+
11
+ if [ "$git_host" = "" ]; then
12
+ git_host="github.com"
13
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
+ fi
15
+
16
+ if [ "$git_user_id" = "" ]; then
17
+ git_user_id="GIT_USER_ID"
18
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
+ fi
20
+
21
+ if [ "$git_repo_id" = "" ]; then
22
+ git_repo_id="GIT_REPO_ID"
23
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
+ fi
25
+
26
+ if [ "$release_note" = "" ]; then
27
+ release_note="Minor update"
28
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
+ fi
30
+
31
+ # Initialize the local directory as a Git repository
32
+ git init
33
+
34
+ # Adds the files in the local repository and stages them for commit.
35
+ git add .
36
+
37
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
+ git commit -m "$release_note"
39
+
40
+ # Sets the new remote
41
+ git_remote=$(git remote)
42
+ if [ "$git_remote" = "" ]; then # git remote not defined
43
+
44
+ if [ "$GIT_TOKEN" = "" ]; then
45
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
+ else
48
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
+ fi
50
+
51
+ fi
52
+
53
+ git pull origin master
54
+
55
+ # Pushes (Forces) the changes in the local repository up to the remote repository
56
+ echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
+ git push origin master 2>&1 | grep -v 'To https'
package/hooks.json CHANGED
@@ -1,8 +1,8 @@
1
- [
2
- {
3
- "id": "trigger-workflow",
4
- "execute-command": "/home/dzkfzn/gambulls-apis/workflow.sh",
5
- "command-working-directory": "/home/dzkfzn/gambulls-apis",
6
- "response-message": "Triggered workflow successfully"
7
- }
8
- ]
1
+ [
2
+ {
3
+ "id": "trigger-workflow",
4
+ "execute-command": "/home/dzkfzn/gambulls-apis/workflow.sh",
5
+ "command-working-directory": "/home/dzkfzn/gambulls-apis",
6
+ "response-message": "Triggered workflow successfully"
7
+ }
8
+ ]