@botpress/api 0.18.5 → 0.19.1

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.js CHANGED
@@ -259140,7 +259140,7 @@ __export(src_exports, {
259140
259140
  });
259141
259141
  module.exports = __toCommonJS(src_exports);
259142
259142
 
259143
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.7.10_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
259143
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.8.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
259144
259144
  var import_zod_openapi = __toESM(require_src(), 1);
259145
259145
  var import_zod_openapi2 = __toESM(require_src(), 1);
259146
259146
  var import_chalk = __toESM(require_source(), 1);
@@ -259184,7 +259184,7 @@ var title = (str2) => {
259184
259184
  return str2.split(/(?=[A-Z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => capitalize(s.toLowerCase())).join(" ");
259185
259185
  };
259186
259186
 
259187
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.7.10_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
259187
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.8.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
259188
259188
  var import_decompress = __toESM(require_decompress(), 1);
259189
259189
  var import_fs2 = __toESM(require("fs"), 1);
259190
259190
  var import_promises = __toESM(require("fs/promises"), 1);
@@ -266418,7 +266418,7 @@ async function openapiTS(schema3, options = {}) {
266418
266418
  }
266419
266419
  var dist_default = openapiTS;
266420
266420
 
266421
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.7.10_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
266421
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.8.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
266422
266422
  var import_zod_openapi3 = __toESM(require_src(), 1);
266423
266423
  var import_openapi3_ts = __toESM(require_dist3(), 1);
266424
266424
  var import_verror2 = __toESM(require_verror(), 1);
@@ -270060,7 +270060,7 @@ var z = /* @__PURE__ */ Object.freeze({
270060
270060
  ZodError
270061
270061
  });
270062
270062
 
270063
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.7.10_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
270063
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.8.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
270064
270064
  var import_openapi_parser = __toESM(require_lib10(), 1);
270065
270065
  var import_json_schema_to_typescript = __toESM(require_src3(), 1);
270066
270066
  var import_zod_openapi4 = __toESM(require_src(), 1);
@@ -270165,16 +270165,17 @@ ${generateParameterFields(props)}
270165
270165
  res.status(${props.status}).json(output)
270166
270166
  }
270167
270167
  `;
270168
- var generateBodyField = (operationName) => ` ...req.body as NonNullable<components['requestBodies']['${operationName}Body']>['content']['application/json'],`;
270168
+ var generateBodyField = (operationName, contentType) => ` ...req.body as NonNullable<components['requestBodies']['${operationName}Body']>['content']['${contentType}'],`;
270169
270169
  var generateParameterFields = ({
270170
270170
  cookies,
270171
270171
  headers,
270172
270172
  params,
270173
270173
  queries,
270174
270174
  body,
270175
- operationName
270175
+ operationName,
270176
+ contentType
270176
270177
  }) => [
270177
- body ? generateBodyField(operationName) : void 0,
270178
+ body ? generateBodyField(operationName, contentType) : void 0,
270178
270179
  ...cookies.map(
270179
270180
  (cookie) => generateField(cookie.name, "cookies", cookie.parameter, cookie.parameter.required !== false)
270180
270181
  ),
@@ -270379,7 +270380,10 @@ function getParameters({ params, headers, queries, cookies }) {
270379
270380
  }
270380
270381
  var typesCode = `
270381
270382
 
270382
- type RequestBody = { requestBody?: { content: { 'application/json': {} } } }
270383
+ type JsonRequestBody = { requestBody?: { content: { 'application/json': {} } } }
270384
+ type BinaryRequestBody = { requestBody?: { content: { '*/*': {} } } }
270385
+
270386
+ type RequestBody = JsonRequestBody | BinaryRequestBody
270383
270387
  type Responses = { responses: { default: { content: { 'application/json': {} } } } }
270384
270388
  type Parameters = { parameters?: {} }
270385
270389
 
@@ -270388,7 +270392,7 @@ type GetHeaderParameters<T> = T extends { header?: any } ? NonNullable<T['header
270388
270392
  type GetCookieParameters<T> = T extends { cookie?: any } ? NonNullable<T['cookie']> : {}
270389
270393
  type GetQueryParameters<T> = T extends { query?: any } ? NonNullable<T['query']> : {}
270390
270394
 
270391
- type GetRequestBody<T> = T extends RequestBody ? NonNullable<T['requestBody']>['content']['application/json'] : {}
270395
+ type GetRequestBody<T> = T extends JsonRequestBody ? NonNullable<T['requestBody']>['content']['application/json'] : T extends BinaryRequestBody ? NonNullable<T['requestBody']>['content']['*/*'] : {}
270392
270396
  type GetParameters<T> = T extends Parameters
270393
270397
  ? GetPathParameters<NonNullable<T['parameters']>> &
270394
270398
  GetHeaderParameters<NonNullable<T['parameters']>> &
@@ -270895,10 +270899,11 @@ var createOpenapi = (state2) => {
270895
270899
  };
270896
270900
  if (isOperationWithBodyProps(operationObject)) {
270897
270901
  const requestBody = operationObject.requestBody;
270902
+ const contentType = operationObject.contentType ?? "application/json";
270898
270903
  openapi.addRequestBody(bodyName, {
270899
270904
  description: requestBody.description,
270900
270905
  content: {
270901
- "application/json": {
270906
+ [contentType]: {
270902
270907
  schema: requestBody.schema
270903
270908
  }
270904
270909
  }
@@ -271338,7 +271343,8 @@ function mapOperationPropsToHandlerProps(operationName, operation) {
271338
271343
  queries: [],
271339
271344
  params: [],
271340
271345
  body: isOperationWithBodyProps(operation) ? true : false,
271341
- isEmptyBody: isOperationWithBodyProps(operation) ? schemaIsEmptyObject(operation.requestBody.schema) : true
271346
+ isEmptyBody: isOperationWithBodyProps(operation) ? schemaIsEmptyObject(operation.requestBody.schema) : true,
271347
+ contentType: isOperationWithBodyProps(operation) ? operation.contentType ?? "application/json" : "application/json"
271342
271348
  };
271343
271349
  if (operation.parameters) {
271344
271350
  (_a = Object.entries(operation.parameters)) == null ? void 0 : _a.forEach(([name, parameter]) => {
@@ -271364,7 +271370,7 @@ function mapOperationPropsToHandlerProps(operationName, operation) {
271364
271370
  return generateHandlerProps;
271365
271371
  }
271366
271372
  var addOperation = (state2, operationProps) => {
271367
- var _a, _b;
271373
+ var _a, _b, _c;
271368
271374
  const { name } = operationProps;
271369
271375
  const responseName = formatResponseName(name);
271370
271376
  const bodyName = formatBodyName(name);
@@ -271387,7 +271393,10 @@ var addOperation = (state2, operationProps) => {
271387
271393
  const response = {
271388
271394
  description: operationProps.response.description,
271389
271395
  status: operationProps.response.status,
271390
- schema: generateSchemaFromZod((0, import_zod_openapi4.extendApi)(operationProps.response.schema, { title: responseName }), state2.options)
271396
+ schema: generateSchemaFromZod(
271397
+ (0, import_zod_openapi4.extendApi)(operationProps.response.schema, { title: responseName, format: operationProps.response.format }),
271398
+ state2.options
271399
+ )
271391
271400
  };
271392
271401
  let operation;
271393
271402
  if (isOperationWithBodyProps(operationProps)) {
@@ -271399,7 +271408,10 @@ var addOperation = (state2, operationProps) => {
271399
271408
  response,
271400
271409
  requestBody: {
271401
271410
  description: operationProps.requestBody.description,
271402
- schema: generateSchemaFromZod((0, import_zod_openapi4.extendApi)(operationProps.requestBody.schema, { title: bodyName }), state2.options)
271411
+ schema: generateSchemaFromZod(
271412
+ (0, import_zod_openapi4.extendApi)(operationProps.requestBody.schema, { title: bodyName, format: (_a = operationProps.requestBody) == null ? void 0 : _a.format }),
271413
+ state2.options
271414
+ )
271403
271415
  }
271404
271416
  };
271405
271417
  } else {
@@ -271413,7 +271425,7 @@ var addOperation = (state2, operationProps) => {
271413
271425
  }
271414
271426
  validateParametersInPath(path2, parameters);
271415
271427
  state2.operations[name] = operation;
271416
- (_b = (_a = state2.sections.find((section) => section.name === operationProps.section)) == null ? void 0 : _a.operations) == null ? void 0 : _b.push(name);
271428
+ (_c = (_b = state2.sections.find((section) => section.name === operationProps.section)) == null ? void 0 : _b.operations) == null ? void 0 : _c.push(name);
271417
271429
  };
271418
271430
  function createParameters(parameters = {}, defaultParameters = {}, disableDefaultParameters = {}) {
271419
271431
  const params = parameters;
@@ -278606,54 +278618,130 @@ var state = {
278606
278618
  },
278607
278619
  "createFile": {
278608
278620
  "name": "createFile",
278609
- "description": "Create File",
278621
+ "path": "/v1/files",
278622
+ "description": "Creates a file.",
278610
278623
  "method": "post",
278611
- "path": "/v1/storage/files",
278612
- "section": "file",
278613
278624
  "requestBody": {
278614
- "description": "Create File",
278625
+ "description": "The file to upload.",
278615
278626
  "schema": {
278616
278627
  "type": "object",
278617
278628
  "properties": {
278618
- "botId": {
278619
- "type": "string",
278620
- "format": "uuid",
278621
- "description": "ID of the bot the file will be used for"
278622
- },
278623
- "contents": {
278624
- "type": "string",
278625
- "description": "Base64-encoded file contents"
278626
- },
278627
- "name": {
278628
- "type": "string",
278629
- "description": "Optional arbitrary file name (e.g. my-image.jpg), will be used for display purposes only."
278630
- },
278631
- "accessType": {
278632
- "type": "string",
278633
- "enum": [
278634
- "private",
278635
- "public"
278636
- ],
278637
- "description": "Accepted values: private, public"
278629
+ "data": {
278630
+ "nullable": true
278638
278631
  }
278639
278632
  },
278640
- "required": [
278641
- "botId",
278642
- "contents",
278643
- "name",
278644
- "accessType"
278645
- ],
278646
278633
  "title": "createFileBody",
278634
+ "format": "binary",
278647
278635
  "additionalProperties": false
278648
278636
  }
278649
278637
  },
278638
+ "parameters": {
278639
+ "x-filename": {
278640
+ "type": "string",
278641
+ "description": "File name",
278642
+ "in": "header",
278643
+ "required": true
278644
+ },
278645
+ "x-tags": {
278646
+ "type": "string",
278647
+ "description": "File tags as URL-encoded JSON string representing an object of key-value pairs.",
278648
+ "in": "header"
278649
+ },
278650
+ "x-access-policies": {
278651
+ "type": "string",
278652
+ "description": "File access policies",
278653
+ "in": "header"
278654
+ },
278655
+ "Content-Type": {
278656
+ "type": "string",
278657
+ "description": "File content type",
278658
+ "in": "header"
278659
+ },
278660
+ "Content-Length": {
278661
+ "type": "string",
278662
+ "description": "File content length",
278663
+ "in": "header"
278664
+ },
278665
+ "x-bot-id": {
278666
+ "in": "header",
278667
+ "description": "Bot id",
278668
+ "type": "string",
278669
+ "required": true
278670
+ },
278671
+ "x-integration-id": {
278672
+ "in": "header",
278673
+ "description": "Integration id",
278674
+ "type": "string",
278675
+ "required": false
278676
+ },
278677
+ "x-user-id": {
278678
+ "in": "header",
278679
+ "description": "User id",
278680
+ "type": "string",
278681
+ "required": false
278682
+ },
278683
+ "x-user-role": {
278684
+ "in": "header",
278685
+ "description": "User role",
278686
+ "type": "string",
278687
+ "required": false
278688
+ }
278689
+ },
278690
+ "contentType": "*/*",
278691
+ "section": "files",
278650
278692
  "response": {
278651
- "description": "Success",
278693
+ "description": "The file metadata.",
278652
278694
  "schema": {
278653
278695
  "type": "object",
278654
278696
  "properties": {
278655
278697
  "file": {
278656
- "$ref": "#/components/schemas/File"
278698
+ "type": "object",
278699
+ "properties": {
278700
+ "id": {
278701
+ "type": "string"
278702
+ },
278703
+ "botId": {
278704
+ "type": "string"
278705
+ },
278706
+ "filename": {
278707
+ "type": "string"
278708
+ },
278709
+ "bytes": {
278710
+ "type": "number",
278711
+ "nullable": true
278712
+ },
278713
+ "tags": {
278714
+ "type": "object",
278715
+ "additionalProperties": {
278716
+ "type": "string",
278717
+ "maxLength": 1e3
278718
+ },
278719
+ "description": "Set of tags that you can attach to a file. Individual keys can be unset by setting them to a `null` value."
278720
+ },
278721
+ "createdAt": {
278722
+ "type": "string"
278723
+ },
278724
+ "updatedAt": {
278725
+ "type": "string"
278726
+ },
278727
+ "accessPolicies": {
278728
+ "type": "array",
278729
+ "items": {
278730
+ "type": "string"
278731
+ }
278732
+ }
278733
+ },
278734
+ "required": [
278735
+ "id",
278736
+ "botId",
278737
+ "filename",
278738
+ "bytes",
278739
+ "tags",
278740
+ "createdAt",
278741
+ "updatedAt",
278742
+ "accessPolicies"
278743
+ ],
278744
+ "additionalProperties": false
278657
278745
  }
278658
278746
  },
278659
278747
  "required": [
@@ -278662,128 +278750,399 @@ var state = {
278662
278750
  "title": "createFileResponse",
278663
278751
  "additionalProperties": false
278664
278752
  }
278665
- },
278666
- "parameters": {}
278753
+ }
278667
278754
  },
278668
- "getFile": {
278669
- "name": "getFile",
278670
- "description": "Get File",
278671
- "method": "get",
278672
- "path": "/v1/storage/files/{id}",
278673
- "section": "file",
278755
+ "deleteFile": {
278756
+ "name": "deleteFile",
278757
+ "path": "/v1/files/{id}",
278758
+ "description": "Deletes a file.",
278759
+ "method": "delete",
278760
+ "section": "files",
278674
278761
  "parameters": {
278675
278762
  "id": {
278676
278763
  "type": "string",
278677
278764
  "description": "File ID",
278678
278765
  "in": "path"
278766
+ },
278767
+ "x-bot-id": {
278768
+ "in": "header",
278769
+ "description": "Bot id",
278770
+ "type": "string",
278771
+ "required": true
278772
+ },
278773
+ "x-integration-id": {
278774
+ "in": "header",
278775
+ "description": "Integration id",
278776
+ "type": "string",
278777
+ "required": false
278778
+ },
278779
+ "x-user-id": {
278780
+ "in": "header",
278781
+ "description": "User id",
278782
+ "type": "string",
278783
+ "required": false
278784
+ },
278785
+ "x-user-role": {
278786
+ "in": "header",
278787
+ "description": "User role",
278788
+ "type": "string",
278789
+ "required": false
278679
278790
  }
278680
278791
  },
278681
278792
  "response": {
278682
- "description": "Success",
278793
+ "description": "Empty response.",
278794
+ "schema": {
278795
+ "type": "object",
278796
+ "title": "deleteFileResponse",
278797
+ "additionalProperties": false
278798
+ }
278799
+ }
278800
+ },
278801
+ "listFiles": {
278802
+ "name": "listFiles",
278803
+ "path": "/v1/files/bot/{botId}",
278804
+ "description": "List files for bot",
278805
+ "method": "get",
278806
+ "section": "files",
278807
+ "parameters": {
278808
+ "nextToken": {
278809
+ "in": "query",
278810
+ "description": "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
278811
+ "type": "string"
278812
+ },
278813
+ "x-bot-id": {
278814
+ "in": "header",
278815
+ "description": "Bot id",
278816
+ "type": "string",
278817
+ "required": true
278818
+ },
278819
+ "x-integration-id": {
278820
+ "in": "header",
278821
+ "description": "Integration id",
278822
+ "type": "string",
278823
+ "required": false
278824
+ },
278825
+ "x-user-id": {
278826
+ "in": "header",
278827
+ "description": "User id",
278828
+ "type": "string",
278829
+ "required": false
278830
+ },
278831
+ "x-user-role": {
278832
+ "in": "header",
278833
+ "description": "User role",
278834
+ "type": "string",
278835
+ "required": false
278836
+ },
278837
+ "botId": {
278838
+ "type": "string",
278839
+ "description": "Bot ID",
278840
+ "in": "path"
278841
+ },
278842
+ "tags": {
278843
+ "in": "query",
278844
+ "type": "string",
278845
+ "description": "Tags to filter files by as a JSON string representing an object of key-value pairs to match files' tags against."
278846
+ }
278847
+ },
278848
+ "response": {
278849
+ "description": "Returns the list of files related to the bot.",
278683
278850
  "schema": {
278684
278851
  "type": "object",
278685
278852
  "properties": {
278686
- "file": {
278687
- "$ref": "#/components/schemas/File"
278853
+ "files": {
278854
+ "type": "array",
278855
+ "items": {
278856
+ "type": "object",
278857
+ "properties": {
278858
+ "id": {
278859
+ "type": "string"
278860
+ },
278861
+ "botId": {
278862
+ "type": "string"
278863
+ },
278864
+ "filename": {
278865
+ "type": "string"
278866
+ },
278867
+ "bytes": {
278868
+ "type": "number",
278869
+ "nullable": true
278870
+ },
278871
+ "createdAt": {
278872
+ "type": "string"
278873
+ },
278874
+ "updatedAt": {
278875
+ "type": "string"
278876
+ },
278877
+ "accessPolicies": {
278878
+ "type": "array",
278879
+ "items": {
278880
+ "type": "string"
278881
+ }
278882
+ }
278883
+ },
278884
+ "required": [
278885
+ "id",
278886
+ "botId",
278887
+ "filename",
278888
+ "bytes",
278889
+ "createdAt",
278890
+ "updatedAt",
278891
+ "accessPolicies"
278892
+ ]
278893
+ }
278894
+ },
278895
+ "meta": {
278896
+ "type": "object",
278897
+ "properties": {
278898
+ "nextToken": {
278899
+ "type": "string",
278900
+ "description": "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."
278901
+ }
278902
+ },
278903
+ "additionalProperties": false
278688
278904
  }
278689
278905
  },
278690
278906
  "required": [
278691
- "file"
278907
+ "files",
278908
+ "meta"
278692
278909
  ],
278693
- "title": "getFileResponse",
278910
+ "title": "listFilesResponse",
278694
278911
  "additionalProperties": false
278695
278912
  }
278696
278913
  }
278697
278914
  },
278698
- "downloadFile": {
278699
- "name": "downloadFile",
278700
- "description": "Download File",
278915
+ "getFileMetadata": {
278916
+ "name": "getFileMetadata",
278917
+ "path": "/v1/files/{id}/metadata",
278918
+ "description": "Get file metadata",
278701
278919
  "method": "get",
278702
- "path": "/v1/storage/files/{id}/download",
278703
- "section": "file",
278920
+ "section": "files",
278704
278921
  "parameters": {
278705
278922
  "id": {
278706
278923
  "type": "string",
278707
278924
  "description": "File ID",
278708
278925
  "in": "path"
278926
+ },
278927
+ "x-bot-id": {
278928
+ "in": "header",
278929
+ "description": "Bot id",
278930
+ "type": "string",
278931
+ "required": true
278932
+ },
278933
+ "x-integration-id": {
278934
+ "in": "header",
278935
+ "description": "Integration id",
278936
+ "type": "string",
278937
+ "required": false
278938
+ },
278939
+ "x-user-id": {
278940
+ "in": "header",
278941
+ "description": "User id",
278942
+ "type": "string",
278943
+ "required": false
278944
+ },
278945
+ "x-user-role": {
278946
+ "in": "header",
278947
+ "description": "User role",
278948
+ "type": "string",
278949
+ "required": false
278709
278950
  }
278710
278951
  },
278711
278952
  "response": {
278712
- "description": "Raw file contents",
278953
+ "description": "The metadata of the file.",
278713
278954
  "schema": {
278714
- "nullable": true,
278715
- "title": "downloadFileResponse"
278955
+ "type": "object",
278956
+ "properties": {
278957
+ "file": {
278958
+ "type": "object",
278959
+ "properties": {
278960
+ "id": {
278961
+ "type": "string"
278962
+ },
278963
+ "botId": {
278964
+ "type": "string"
278965
+ },
278966
+ "filename": {
278967
+ "type": "string"
278968
+ },
278969
+ "bytes": {
278970
+ "type": "number",
278971
+ "nullable": true
278972
+ },
278973
+ "tags": {
278974
+ "type": "object",
278975
+ "additionalProperties": {
278976
+ "type": "string",
278977
+ "maxLength": 1e3
278978
+ },
278979
+ "description": "Set of tags that you can attach to a file. Individual keys can be unset by setting them to a `null` value."
278980
+ },
278981
+ "createdAt": {
278982
+ "type": "string"
278983
+ },
278984
+ "updatedAt": {
278985
+ "type": "string"
278986
+ },
278987
+ "accessPolicies": {
278988
+ "type": "array",
278989
+ "items": {
278990
+ "type": "string"
278991
+ }
278992
+ }
278993
+ },
278994
+ "required": [
278995
+ "id",
278996
+ "botId",
278997
+ "filename",
278998
+ "bytes",
278999
+ "tags",
279000
+ "createdAt",
279001
+ "updatedAt",
279002
+ "accessPolicies"
279003
+ ],
279004
+ "additionalProperties": false
279005
+ }
279006
+ },
279007
+ "required": [
279008
+ "file"
279009
+ ],
279010
+ "title": "getFileMetadataResponse",
279011
+ "additionalProperties": false
278716
279012
  }
278717
279013
  }
278718
279014
  },
278719
- "deleteFile": {
278720
- "name": "deleteFile",
278721
- "description": "Delete File",
278722
- "method": "delete",
278723
- "path": "/v1/storage/files/{id}",
278724
- "section": "file",
279015
+ "getFileContent": {
279016
+ "name": "getFileContent",
279017
+ "path": "/v1/files/{id}/content",
279018
+ "description": "Returns a presigned URL to download the file content.",
279019
+ "method": "get",
279020
+ "section": "files",
278725
279021
  "parameters": {
278726
279022
  "id": {
278727
279023
  "type": "string",
278728
279024
  "description": "File ID",
278729
279025
  "in": "path"
279026
+ },
279027
+ "x-bot-id": {
279028
+ "in": "header",
279029
+ "description": "Bot id",
279030
+ "type": "string",
279031
+ "required": true
279032
+ },
279033
+ "x-integration-id": {
279034
+ "in": "header",
279035
+ "description": "Integration id",
279036
+ "type": "string",
279037
+ "required": false
279038
+ },
279039
+ "x-user-id": {
279040
+ "in": "header",
279041
+ "description": "User id",
279042
+ "type": "string",
279043
+ "required": false
279044
+ },
279045
+ "x-user-role": {
279046
+ "in": "header",
279047
+ "description": "User role",
279048
+ "type": "string",
279049
+ "required": false
278730
279050
  }
278731
279051
  },
278732
279052
  "response": {
278733
- "description": "Success",
279053
+ "description": "Returns a temporary pre-signed URL to download the file content.",
278734
279054
  "schema": {
278735
279055
  "type": "object",
278736
- "title": "deleteFileResponse",
279056
+ "properties": {
279057
+ "url": {
279058
+ "type": "string",
279059
+ "description": "Temporary pre-signed URL to download the file, should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."
279060
+ }
279061
+ },
279062
+ "required": [
279063
+ "url"
279064
+ ],
279065
+ "title": "getFileContentResponse",
278737
279066
  "additionalProperties": false
278738
279067
  }
278739
279068
  }
278740
279069
  },
278741
- "listFiles": {
278742
- "name": "listFiles",
278743
- "description": "List Files",
278744
- "method": "get",
278745
- "path": "/v1/storage/files",
278746
- "section": "file",
279070
+ "updateFileMetadata": {
279071
+ "name": "updateFileMetadata",
279072
+ "path": "/v1/files/{id}/metadata",
279073
+ "description": "Update file metadata",
279074
+ "method": "put",
279075
+ "section": "files",
278747
279076
  "parameters": {
278748
- "nextToken": {
278749
- "in": "query",
278750
- "description": "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
278751
- "type": "string"
279077
+ "id": {
279078
+ "type": "string",
279079
+ "description": "File ID",
279080
+ "in": "path"
278752
279081
  },
278753
- "botId": {
278754
- "in": "query",
279082
+ "x-bot-id": {
279083
+ "in": "header",
279084
+ "description": "Bot id",
278755
279085
  "type": "string",
278756
- "description": "Bot ID",
278757
279086
  "required": true
279087
+ },
279088
+ "x-integration-id": {
279089
+ "in": "header",
279090
+ "description": "Integration id",
279091
+ "type": "string",
279092
+ "required": false
279093
+ },
279094
+ "x-user-id": {
279095
+ "in": "header",
279096
+ "description": "User id",
279097
+ "type": "string",
279098
+ "required": false
279099
+ },
279100
+ "x-user-role": {
279101
+ "in": "header",
279102
+ "description": "User role",
279103
+ "type": "string",
279104
+ "required": false
279105
+ }
279106
+ },
279107
+ "requestBody": {
279108
+ "description": "File metadata to update.",
279109
+ "schema": {
279110
+ "type": "object",
279111
+ "properties": {
279112
+ "tags": {
279113
+ "type": "object",
279114
+ "additionalProperties": {
279115
+ "type": "string",
279116
+ "maxLength": 1e3
279117
+ },
279118
+ "description": "Set of tags that you can attach to a file. Individual keys can be unset by setting them to a `null` value."
279119
+ }
279120
+ },
279121
+ "required": [
279122
+ "tags"
279123
+ ],
279124
+ "title": "updateFileMetadataBody",
279125
+ "additionalProperties": false
278758
279126
  }
278759
279127
  },
278760
279128
  "response": {
278761
- "description": "Success",
279129
+ "description": "An object containing the updated metadata of the file.",
278762
279130
  "schema": {
278763
279131
  "type": "object",
278764
279132
  "properties": {
278765
- "files": {
278766
- "type": "array",
278767
- "items": {
278768
- "$ref": "#/components/schemas/File"
278769
- }
278770
- },
278771
- "meta": {
279133
+ "tags": {
278772
279134
  "type": "object",
278773
- "properties": {
278774
- "nextToken": {
278775
- "type": "string",
278776
- "description": "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."
278777
- }
279135
+ "additionalProperties": {
279136
+ "type": "string",
279137
+ "maxLength": 1e3
278778
279138
  },
278779
- "additionalProperties": false
279139
+ "description": "The tags to update as an object of key/value pairs. A tag key can be set to a null value to delete it."
278780
279140
  }
278781
279141
  },
278782
279142
  "required": [
278783
- "files",
278784
- "meta"
279143
+ "tags"
278785
279144
  ],
278786
- "title": "listFilesResponse",
279145
+ "title": "updateFileMetadataResponse",
278787
279146
  "additionalProperties": false
278788
279147
  }
278789
279148
  }
@@ -279496,7 +279855,7 @@ var state = {
279496
279855
  "title": "Botpress API",
279497
279856
  "description": "API for Botpress Cloud",
279498
279857
  "server": "https://api.botpress.cloud",
279499
- "version": "0.18.5",
279858
+ "version": "0.19.1",
279500
279859
  "prefix": "v1"
279501
279860
  },
279502
279861
  "errors": [
@@ -279652,6 +280011,7 @@ var state = {
279652
280011
  "changeAISpendQuotaBody": true,
279653
280012
  "introspectBody": true,
279654
280013
  "createFileBody": true,
280014
+ "updateFileMetadataBody": true,
279655
280015
  "createTableBody": true,
279656
280016
  "updateTableBody": true,
279657
280017
  "renameTableColumnBody": true,
@@ -279757,10 +280117,11 @@ var state = {
279757
280117
  "listActivitiesResponse": true,
279758
280118
  "introspectResponse": true,
279759
280119
  "createFileResponse": true,
279760
- "getFileResponse": true,
279761
- "downloadFileResponse": true,
279762
280120
  "deleteFileResponse": true,
279763
280121
  "listFilesResponse": true,
280122
+ "getFileMetadataResponse": true,
280123
+ "getFileContentResponse": true,
280124
+ "updateFileMetadataResponse": true,
279764
280125
  "listTablesResponse": true,
279765
280126
  "getTableResponse": true,
279766
280127
  "createTableResponse": true,
@@ -279790,10 +280151,10 @@ var state = {
279790
280151
  "Message": true,
279791
280152
  "State": true,
279792
280153
  "Task": true,
279793
- "File": true,
279794
280154
  "Table": true,
279795
280155
  "Column": true,
279796
- "Row": true
280156
+ "Row": true,
280157
+ "File": true
279797
280158
  }
279798
280159
  },
279799
280160
  "schemas": {
@@ -281552,56 +281913,6 @@ var state = {
281552
281913
  "additionalProperties": false
281553
281914
  }
281554
281915
  },
281555
- "File": {
281556
- "section": "file",
281557
- "schema": {
281558
- "type": "object",
281559
- "properties": {
281560
- "botId": {
281561
- "type": "string",
281562
- "format": "uuid",
281563
- "description": "ID of the bot the file will be used for"
281564
- },
281565
- "name": {
281566
- "type": "string",
281567
- "description": "Optional arbitrary file name (e.g. my-image.jpg), will be used for display purposes only."
281568
- },
281569
- "accessType": {
281570
- "type": "string",
281571
- "enum": [
281572
- "private",
281573
- "public"
281574
- ],
281575
- "description": "Accepted values: private, public"
281576
- },
281577
- "id": {
281578
- "type": "string",
281579
- "description": "ID of the [File](#schema_file)"
281580
- },
281581
- "createdAt": {
281582
- "type": "string",
281583
- "description": "Creation date of the [File](#schema_file) in ISO 8601 format"
281584
- },
281585
- "size": {
281586
- "type": "number",
281587
- "description": "Size of the file in bytes"
281588
- },
281589
- "publicUrl": {
281590
- "type": "string",
281591
- "description": "Public URL to the file contents, available only if the access type is public. If the file is private, use the Download endpoint to retrieve the file contents."
281592
- }
281593
- },
281594
- "required": [
281595
- "botId",
281596
- "name",
281597
- "accessType",
281598
- "id",
281599
- "createdAt",
281600
- "size"
281601
- ],
281602
- "additionalProperties": false
281603
- }
281604
- },
281605
281916
  "Table": {
281606
281917
  "section": "tables",
281607
281918
  "schema": {
@@ -281824,6 +282135,58 @@ var state = {
281824
282135
  ],
281825
282136
  "additionalProperties": true
281826
282137
  }
282138
+ },
282139
+ "File": {
282140
+ "section": "files",
282141
+ "schema": {
282142
+ "type": "object",
282143
+ "properties": {
282144
+ "id": {
282145
+ "type": "string"
282146
+ },
282147
+ "botId": {
282148
+ "type": "string"
282149
+ },
282150
+ "filename": {
282151
+ "type": "string"
282152
+ },
282153
+ "bytes": {
282154
+ "type": "number",
282155
+ "nullable": true
282156
+ },
282157
+ "tags": {
282158
+ "type": "object",
282159
+ "additionalProperties": {
282160
+ "type": "string",
282161
+ "maxLength": 1e3
282162
+ },
282163
+ "description": "Set of tags that you can attach to a file. Individual keys can be unset by setting them to a `null` value."
282164
+ },
282165
+ "createdAt": {
282166
+ "type": "string"
282167
+ },
282168
+ "updatedAt": {
282169
+ "type": "string"
282170
+ },
282171
+ "accessPolicies": {
282172
+ "type": "array",
282173
+ "items": {
282174
+ "type": "string"
282175
+ }
282176
+ }
282177
+ },
282178
+ "required": [
282179
+ "id",
282180
+ "botId",
282181
+ "filename",
282182
+ "bytes",
282183
+ "tags",
282184
+ "createdAt",
282185
+ "updatedAt",
282186
+ "accessPolicies"
282187
+ ],
282188
+ "additionalProperties": false
282189
+ }
281827
282190
  }
281828
282191
  },
281829
282192
  "sections": [
@@ -281888,14 +282251,7 @@ var state = {
281888
282251
  "description": "",
281889
282252
  "title": "File",
281890
282253
  "name": "file",
281891
- "operations": [
281892
- "createFile",
281893
- "getFile",
281894
- "downloadFile",
281895
- "deleteFile",
281896
- "listFiles"
281897
- ],
281898
- "schema": "File"
282254
+ "operations": []
281899
282255
  },
281900
282256
  {
281901
282257
  "description": "",
@@ -282082,6 +282438,20 @@ var state = {
282082
282438
  "upsertTableRows"
282083
282439
  ],
282084
282440
  "schema": "Table"
282441
+ },
282442
+ {
282443
+ "title": "Files",
282444
+ "description": "Operations related to file management.",
282445
+ "name": "files",
282446
+ "operations": [
282447
+ "createFile",
282448
+ "deleteFile",
282449
+ "listFiles",
282450
+ "getFileMetadata",
282451
+ "getFileContent",
282452
+ "updateFileMetadata"
282453
+ ],
282454
+ "schema": "File"
282085
282455
  }
282086
282456
  ],
282087
282457
  "options": {