@platzio/sdk 0.6.0-beta.1-1 → 0.6.0-beta.2

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/dist/index.mjs CHANGED
@@ -173,6 +173,7 @@ var DbEventOperation = {
173
173
  Delete: "DELETE"
174
174
  };
175
175
  var DbTable = {
176
+ Bots: "bots",
176
177
  DeploymentKinds: "deployment_kinds",
177
178
  DeploymentResources: "deployment_resources",
178
179
  DeploymentResourceTypes: "deployment_resource_types",
@@ -422,6 +423,222 @@ var AuthenticationApi = class extends BaseAPI {
422
423
  return AuthenticationApiFp(this.configuration).startGoogleLogin(options).then((request) => request(this.axios, this.basePath));
423
424
  }
424
425
  };
426
+ var BotsApiAxiosParamCreator = function(configuration) {
427
+ return {
428
+ /**
429
+ *
430
+ * @param {string | null} [displayName]
431
+ * @param {number | null} [page]
432
+ * @param {number | null} [perPage]
433
+ * @param {*} [options] Override http request option.
434
+ * @throws {RequiredError}
435
+ */
436
+ allBots: (_0, _1, _2, ..._3) => __async(this, [_0, _1, _2, ..._3], function* (displayName, page, perPage, options = {}) {
437
+ const localVarPath = `/api/v2/bots`;
438
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
439
+ let baseOptions;
440
+ if (configuration) {
441
+ baseOptions = configuration.baseOptions;
442
+ }
443
+ const localVarRequestOptions = __spreadValues(__spreadValues({ method: "GET" }, baseOptions), options);
444
+ const localVarHeaderParameter = {};
445
+ const localVarQueryParameter = {};
446
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
447
+ yield setApiKeyToObject(localVarHeaderParameter, "x-platz-token", configuration);
448
+ if (displayName !== void 0) {
449
+ localVarQueryParameter["display_name"] = displayName;
450
+ }
451
+ if (page !== void 0) {
452
+ localVarQueryParameter["page"] = page;
453
+ }
454
+ if (perPage !== void 0) {
455
+ localVarQueryParameter["per_page"] = perPage;
456
+ }
457
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
458
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
459
+ localVarRequestOptions.headers = __spreadValues(__spreadValues(__spreadValues({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
460
+ return {
461
+ url: toPathString(localVarUrlObj),
462
+ options: localVarRequestOptions
463
+ };
464
+ }),
465
+ /**
466
+ *
467
+ * @param {string} id
468
+ * @param {*} [options] Override http request option.
469
+ * @throws {RequiredError}
470
+ */
471
+ getBot: (_0, ..._1) => __async(this, [_0, ..._1], function* (id, options = {}) {
472
+ assertParamExists("getBot", "id", id);
473
+ const localVarPath = `/api/v2/bots/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
474
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
475
+ let baseOptions;
476
+ if (configuration) {
477
+ baseOptions = configuration.baseOptions;
478
+ }
479
+ const localVarRequestOptions = __spreadValues(__spreadValues({ method: "GET" }, baseOptions), options);
480
+ const localVarHeaderParameter = {};
481
+ const localVarQueryParameter = {};
482
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
483
+ yield setApiKeyToObject(localVarHeaderParameter, "x-platz-token", configuration);
484
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
485
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
486
+ localVarRequestOptions.headers = __spreadValues(__spreadValues(__spreadValues({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
487
+ return {
488
+ url: toPathString(localVarUrlObj),
489
+ options: localVarRequestOptions
490
+ };
491
+ }),
492
+ /**
493
+ *
494
+ * @param {string} id
495
+ * @param {UpdateBot} updateBot
496
+ * @param {*} [options] Override http request option.
497
+ * @throws {RequiredError}
498
+ */
499
+ updateBot: (_0, _1, ..._2) => __async(this, [_0, _1, ..._2], function* (id, updateBot, options = {}) {
500
+ assertParamExists("updateBot", "id", id);
501
+ assertParamExists("updateBot", "updateBot", updateBot);
502
+ const localVarPath = `/api/v2/bots/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
503
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
504
+ let baseOptions;
505
+ if (configuration) {
506
+ baseOptions = configuration.baseOptions;
507
+ }
508
+ const localVarRequestOptions = __spreadValues(__spreadValues({ method: "PUT" }, baseOptions), options);
509
+ const localVarHeaderParameter = {};
510
+ const localVarQueryParameter = {};
511
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
512
+ yield setApiKeyToObject(localVarHeaderParameter, "x-platz-token", configuration);
513
+ localVarHeaderParameter["Content-Type"] = "application/json";
514
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
515
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
516
+ localVarRequestOptions.headers = __spreadValues(__spreadValues(__spreadValues({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
517
+ localVarRequestOptions.data = serializeDataIfNeeded(updateBot, localVarRequestOptions, configuration);
518
+ return {
519
+ url: toPathString(localVarUrlObj),
520
+ options: localVarRequestOptions
521
+ };
522
+ })
523
+ };
524
+ };
525
+ var BotsApiFp = function(configuration) {
526
+ const localVarAxiosParamCreator = BotsApiAxiosParamCreator(configuration);
527
+ return {
528
+ /**
529
+ *
530
+ * @param {string | null} [displayName]
531
+ * @param {number | null} [page]
532
+ * @param {number | null} [perPage]
533
+ * @param {*} [options] Override http request option.
534
+ * @throws {RequiredError}
535
+ */
536
+ allBots(displayName, page, perPage, options) {
537
+ return __async(this, null, function* () {
538
+ var _a2, _b, _c;
539
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.allBots(displayName, page, perPage, options);
540
+ const localVarOperationServerIndex = (_a2 = configuration == null ? void 0 : configuration.serverIndex) != null ? _a2 : 0;
541
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap["BotsApi.allBots"]) == null ? void 0 : _b[localVarOperationServerIndex]) == null ? void 0 : _c.url;
542
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
543
+ });
544
+ },
545
+ /**
546
+ *
547
+ * @param {string} id
548
+ * @param {*} [options] Override http request option.
549
+ * @throws {RequiredError}
550
+ */
551
+ getBot(id, options) {
552
+ return __async(this, null, function* () {
553
+ var _a2, _b, _c;
554
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getBot(id, options);
555
+ const localVarOperationServerIndex = (_a2 = configuration == null ? void 0 : configuration.serverIndex) != null ? _a2 : 0;
556
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap["BotsApi.getBot"]) == null ? void 0 : _b[localVarOperationServerIndex]) == null ? void 0 : _c.url;
557
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
558
+ });
559
+ },
560
+ /**
561
+ *
562
+ * @param {string} id
563
+ * @param {UpdateBot} updateBot
564
+ * @param {*} [options] Override http request option.
565
+ * @throws {RequiredError}
566
+ */
567
+ updateBot(id, updateBot, options) {
568
+ return __async(this, null, function* () {
569
+ var _a2, _b, _c;
570
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateBot(id, updateBot, options);
571
+ const localVarOperationServerIndex = (_a2 = configuration == null ? void 0 : configuration.serverIndex) != null ? _a2 : 0;
572
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap["BotsApi.updateBot"]) == null ? void 0 : _b[localVarOperationServerIndex]) == null ? void 0 : _c.url;
573
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
574
+ });
575
+ }
576
+ };
577
+ };
578
+ var BotsApiFactory = function(configuration, basePath, axios) {
579
+ const localVarFp = BotsApiFp(configuration);
580
+ return {
581
+ /**
582
+ *
583
+ * @param {BotsApiAllBotsRequest} requestParameters Request parameters.
584
+ * @param {*} [options] Override http request option.
585
+ * @throws {RequiredError}
586
+ */
587
+ allBots(requestParameters = {}, options) {
588
+ return localVarFp.allBots(requestParameters.displayName, requestParameters.page, requestParameters.perPage, options).then((request) => request(axios, basePath));
589
+ },
590
+ /**
591
+ *
592
+ * @param {BotsApiGetBotRequest} requestParameters Request parameters.
593
+ * @param {*} [options] Override http request option.
594
+ * @throws {RequiredError}
595
+ */
596
+ getBot(requestParameters, options) {
597
+ return localVarFp.getBot(requestParameters.id, options).then((request) => request(axios, basePath));
598
+ },
599
+ /**
600
+ *
601
+ * @param {BotsApiUpdateBotRequest} requestParameters Request parameters.
602
+ * @param {*} [options] Override http request option.
603
+ * @throws {RequiredError}
604
+ */
605
+ updateBot(requestParameters, options) {
606
+ return localVarFp.updateBot(requestParameters.id, requestParameters.updateBot, options).then((request) => request(axios, basePath));
607
+ }
608
+ };
609
+ };
610
+ var BotsApi = class extends BaseAPI {
611
+ /**
612
+ *
613
+ * @param {BotsApiAllBotsRequest} requestParameters Request parameters.
614
+ * @param {*} [options] Override http request option.
615
+ * @throws {RequiredError}
616
+ * @memberof BotsApi
617
+ */
618
+ allBots(requestParameters = {}, options) {
619
+ return BotsApiFp(this.configuration).allBots(requestParameters.displayName, requestParameters.page, requestParameters.perPage, options).then((request) => request(this.axios, this.basePath));
620
+ }
621
+ /**
622
+ *
623
+ * @param {BotsApiGetBotRequest} requestParameters Request parameters.
624
+ * @param {*} [options] Override http request option.
625
+ * @throws {RequiredError}
626
+ * @memberof BotsApi
627
+ */
628
+ getBot(requestParameters, options) {
629
+ return BotsApiFp(this.configuration).getBot(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
630
+ }
631
+ /**
632
+ *
633
+ * @param {BotsApiUpdateBotRequest} requestParameters Request parameters.
634
+ * @param {*} [options] Override http request option.
635
+ * @throws {RequiredError}
636
+ * @memberof BotsApi
637
+ */
638
+ updateBot(requestParameters, options) {
639
+ return BotsApiFp(this.configuration).updateBot(requestParameters.id, requestParameters.updateBot, options).then((request) => request(this.axios, this.basePath));
640
+ }
641
+ };
425
642
  var DeploymentKindsApiAxiosParamCreator = function(configuration) {
426
643
  return {
427
644
  /**
@@ -4656,6 +4873,10 @@ export {
4656
4873
  AuthenticationApiAxiosParamCreator,
4657
4874
  AuthenticationApiFactory,
4658
4875
  AuthenticationApiFp,
4876
+ BotsApi,
4877
+ BotsApiAxiosParamCreator,
4878
+ BotsApiFactory,
4879
+ BotsApiFp,
4659
4880
  ChartExtActionEndpoint,
4660
4881
  ChartExtActionMethod,
4661
4882
  ChartExtActionUserDeploymentRole,
package/openapi.yaml CHANGED
@@ -51,6 +51,126 @@ paths:
51
51
  security:
52
52
  - access_token: []
53
53
  - user_token: []
54
+ /api/v2/bots:
55
+ get:
56
+ tags:
57
+ - Bots
58
+ operationId: allBots
59
+ parameters:
60
+ - name: display_name
61
+ in: query
62
+ required: false
63
+ schema:
64
+ type: string
65
+ nullable: true
66
+ - name: page
67
+ in: query
68
+ required: false
69
+ schema:
70
+ type: integer
71
+ format: int64
72
+ nullable: true
73
+ - name: per_page
74
+ in: query
75
+ required: false
76
+ schema:
77
+ type: integer
78
+ format: int64
79
+ nullable: true
80
+ responses:
81
+ '200':
82
+ description: ''
83
+ content:
84
+ application/json:
85
+ schema:
86
+ type: object
87
+ required:
88
+ - page
89
+ - per_page
90
+ - items
91
+ - num_total
92
+ properties:
93
+ page:
94
+ type: integer
95
+ format: int64
96
+ example: '1'
97
+ per_page:
98
+ type: integer
99
+ format: int64
100
+ example: '50'
101
+ items:
102
+ type: array
103
+ items:
104
+ type: object
105
+ required:
106
+ - id
107
+ - created_at
108
+ - display_name
109
+ properties:
110
+ id:
111
+ type: string
112
+ format: uuid
113
+ created_at:
114
+ type: string
115
+ format: date-time
116
+ display_name:
117
+ type: string
118
+ num_total:
119
+ type: integer
120
+ format: int64
121
+ example: '1'
122
+ security:
123
+ - access_token: []
124
+ - user_token: []
125
+ /api/v2/bots/{id}:
126
+ get:
127
+ tags:
128
+ - Bots
129
+ operationId: getBot
130
+ parameters:
131
+ - name: id
132
+ in: path
133
+ required: true
134
+ schema:
135
+ type: string
136
+ format: uuid
137
+ responses:
138
+ '200':
139
+ description: ''
140
+ content:
141
+ application/json:
142
+ schema:
143
+ $ref: '#/components/schemas/Bot'
144
+ security:
145
+ - access_token: []
146
+ - user_token: []
147
+ put:
148
+ tags:
149
+ - Bots
150
+ operationId: updateBot
151
+ parameters:
152
+ - name: id
153
+ in: path
154
+ required: true
155
+ schema:
156
+ type: string
157
+ format: uuid
158
+ requestBody:
159
+ content:
160
+ application/json:
161
+ schema:
162
+ $ref: '#/components/schemas/UpdateBot'
163
+ required: true
164
+ responses:
165
+ '200':
166
+ description: ''
167
+ content:
168
+ application/json:
169
+ schema:
170
+ $ref: '#/components/schemas/Bot'
171
+ security:
172
+ - access_token: []
173
+ - user_token: []
54
174
  /api/v2/deployment-kinds:
55
175
  get:
56
176
  tags:
@@ -2533,6 +2653,21 @@ paths:
2533
2653
  - user_token: []
2534
2654
  components:
2535
2655
  schemas:
2656
+ Bot:
2657
+ type: object
2658
+ required:
2659
+ - id
2660
+ - created_at
2661
+ - display_name
2662
+ properties:
2663
+ id:
2664
+ type: string
2665
+ format: uuid
2666
+ created_at:
2667
+ type: string
2668
+ format: date-time
2669
+ display_name:
2670
+ type: string
2536
2671
  CancelDeploymentTask:
2537
2672
  type: object
2538
2673
  required:
@@ -3012,6 +3147,7 @@ components:
3012
3147
  DbTable:
3013
3148
  type: string
3014
3149
  enum:
3150
+ - bots
3015
3151
  - deployment_kinds
3016
3152
  - deployment_resources
3017
3153
  - deployment_resource_types
@@ -3808,6 +3944,12 @@ components:
3808
3944
  properties:
3809
3945
  User:
3810
3946
  $ref: '#/components/schemas/User'
3947
+ - type: object
3948
+ required:
3949
+ - Bot
3950
+ properties:
3951
+ Bot:
3952
+ $ref: '#/components/schemas/Bot'
3811
3953
  - type: object
3812
3954
  required:
3813
3955
  - Deployment
@@ -3823,6 +3965,13 @@ components:
3823
3965
  format: uuid
3824
3966
  name:
3825
3967
  type: string
3968
+ NewBot:
3969
+ type: object
3970
+ required:
3971
+ - display_name
3972
+ properties:
3973
+ display_name:
3974
+ type: string
3826
3975
  NewDeployment:
3827
3976
  type: object
3828
3977
  required:
@@ -4204,6 +4353,12 @@ components:
4204
4353
  $ref: '#/components/schemas/ChartExtVersionV1Beta1'
4205
4354
  kind:
4206
4355
  $ref: '#/components/schemas/ChartExtKindValuesUi'
4356
+ UpdateBot:
4357
+ type: object
4358
+ properties:
4359
+ display_name:
4360
+ type: string
4361
+ nullable: true
4207
4362
  UpdateDeployment:
4208
4363
  type: object
4209
4364
  properties:
@@ -4402,6 +4557,8 @@ tags:
4402
4557
  User tokens are passed in the `x-platz-token` header.
4403
4558
  - name: Users
4404
4559
  description: This collection contains all users in Platz.
4560
+ - name: Bots
4561
+ description: This collection contains all bots in Platz.
4405
4562
  - name: Events
4406
4563
  description: Events sent through the Websocket.
4407
4564
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platzio/sdk",
3
- "version": "0.6.0-beta.1-1",
3
+ "version": "0.6.0-beta.2",
4
4
  "description": "Platz.io SDK",
5
5
  "homepage": "https://platz.io",
6
6
  "repository": {