@meistrari/vault-http-client 2.9.0 → 2.14.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.cjs CHANGED
@@ -3,31 +3,30 @@
3
3
  const core = require('@zodios/core');
4
4
  const zod = require('zod');
5
5
 
6
- const postFilesBulk_Body = zod.z.union([
7
- zod.z.array(
8
- zod.z.object({
9
- fileName: zod.z.string(),
10
- parentId: zod.z.string(),
11
- onMissingParent: zod.z.enum(["error", "create-as-root"]).default("error"),
12
- sha256sum: zod.z.string(),
13
- size: zod.z.number(),
14
- mimeType: zod.z.string(),
15
- createdBy: zod.z.string(),
16
- path: zod.z.string()
17
- }).partial()
18
- ),
19
- zod.z.object({ files: zod.z.array(zod.z.string()) })
20
- ]);
21
6
  const postFiles_Body = zod.z.object({
22
7
  fileName: zod.z.string(),
23
8
  parentId: zod.z.string(),
24
9
  onMissingParent: zod.z.enum(["error", "create-as-root"]).default("error"),
10
+ onParentConflict: zod.z.enum(["error", "update-parent-id", "ignore"]).default("error"),
25
11
  sha256sum: zod.z.string(),
26
12
  size: zod.z.number(),
27
13
  mimeType: zod.z.string(),
28
14
  createdBy: zod.z.string(),
29
15
  path: zod.z.string()
30
16
  }).partial();
17
+ const postFilesBulk_Body = zod.z.array(
18
+ zod.z.object({
19
+ fileName: zod.z.string(),
20
+ parentId: zod.z.string(),
21
+ onMissingParent: zod.z.enum(["error", "create-as-root"]).default("error"),
22
+ onParentConflict: zod.z.enum(["error", "update-parent-id", "ignore"]).default("error"),
23
+ sha256sum: zod.z.string(),
24
+ size: zod.z.number(),
25
+ mimeType: zod.z.string(),
26
+ createdBy: zod.z.string(),
27
+ path: zod.z.string()
28
+ }).partial()
29
+ );
31
30
  const put_WorkspacesByWorkspaceIdSettings_Body = zod.z.object({
32
31
  bucketName: zod.z.string().min(1),
33
32
  keyArns: zod.z.array(zod.z.string()).min(1),
@@ -406,7 +405,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
406
405
  response: zod.z.array(
407
406
  zod.z.object({
408
407
  workspaceId: zod.z.string(),
409
- files: zod.z.number(),
410
408
  permalinks: zod.z.number(),
411
409
  hasCustomSettings: zod.z.boolean()
412
410
  })
@@ -572,6 +570,71 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
572
570
  path: zod.z.string()
573
571
  })
574
572
  },
573
+ {
574
+ method: "get",
575
+ path: "/files",
576
+ description: `Get a list of files.`,
577
+ requestFormat: "json",
578
+ parameters: [
579
+ {
580
+ name: "limit",
581
+ type: "Query",
582
+ schema: zod.z.number().gte(1).lte(500).optional().default(10)
583
+ },
584
+ {
585
+ name: "offset",
586
+ type: "Query",
587
+ schema: zod.z.number().gte(0).optional().default(0)
588
+ },
589
+ {
590
+ name: "orderByField",
591
+ type: "Query",
592
+ schema: zod.z.enum(["id", "createdAt", "deletedAt"]).optional()
593
+ },
594
+ {
595
+ name: "orderByDirection",
596
+ type: "Query",
597
+ schema: zod.z.enum(["asc", "desc"]).optional().default("asc")
598
+ },
599
+ {
600
+ name: "search",
601
+ type: "Query",
602
+ schema: zod.z.string().optional()
603
+ },
604
+ {
605
+ name: "includeDeleted",
606
+ type: "Query",
607
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
608
+ },
609
+ {
610
+ name: "includeChildren",
611
+ type: "Query",
612
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
613
+ }
614
+ ],
615
+ response: zod.z.object({
616
+ files: zod.z.array(
617
+ zod.z.object({
618
+ id: zod.z.string(),
619
+ path: zod.z.string(),
620
+ workspaceId: zod.z.string(),
621
+ parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
622
+ originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
623
+ mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
624
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
625
+ legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
626
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
627
+ encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
628
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
629
+ createdAt: zod.z.string(),
630
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
631
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
632
+ })
633
+ ),
634
+ count: zod.z.number(),
635
+ pages: zod.z.number()
636
+ })
637
+ },
575
638
  {
576
639
  method: "get",
577
640
  path: "/files/:fileId",
@@ -620,6 +683,40 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
620
683
  }
621
684
  ]
622
685
  },
686
+ {
687
+ method: "patch",
688
+ path: "/files/:fileId",
689
+ description: `Update file metadata. This only affects file metadata and has no effect on file conflicts or storage location.`,
690
+ requestFormat: "json",
691
+ parameters: [
692
+ {
693
+ name: "body",
694
+ type: "Body",
695
+ schema: zod.z.object({ name: zod.z.string().min(1) })
696
+ },
697
+ {
698
+ name: "fileId",
699
+ type: "Path",
700
+ schema: zod.z.string()
701
+ }
702
+ ],
703
+ response: zod.z.object({
704
+ id: zod.z.string(),
705
+ path: zod.z.string(),
706
+ workspaceId: zod.z.string(),
707
+ parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
708
+ originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
709
+ mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
710
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
711
+ legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
712
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
713
+ encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
714
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
715
+ createdAt: zod.z.string(),
716
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
717
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
718
+ })
719
+ },
623
720
  {
624
721
  method: "post",
625
722
  path: "/files/:fileId/permalinks",
@@ -867,9 +964,12 @@ The returned `url` is valid for 1 hour by default. You can change the
867
964
  schema: postFilesBulk_Body
868
965
  }
869
966
  ],
870
- response: zod.z.union([
871
- zod.z.array(
872
- zod.z.object({
967
+ response: zod.z.array(
968
+ zod.z.object({
969
+ id: zod.z.string(),
970
+ uploadUrl: zod.z.string(),
971
+ expiresAt: zod.z.string().datetime({ offset: true }),
972
+ metadata: zod.z.object({
873
973
  id: zod.z.string(),
874
974
  path: zod.z.string(),
875
975
  workspaceId: zod.z.string(),
@@ -884,29 +984,10 @@ The returned `url` is valid for 1 hour by default. You can change the
884
984
  createdAt: zod.z.string(),
885
985
  deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
886
986
  uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
887
- })
888
- ),
889
- zod.z.object({
890
- files: zod.z.array(
891
- zod.z.object({
892
- id: zod.z.string(),
893
- path: zod.z.string(),
894
- workspaceId: zod.z.string(),
895
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
896
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
897
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
898
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
899
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
900
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
901
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
902
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
903
- createdAt: zod.z.string(),
904
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
905
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
906
- })
907
- )
987
+ }),
988
+ path: zod.z.string()
908
989
  })
909
- ])
990
+ )
910
991
  },
911
992
  {
912
993
  method: "get",
@@ -978,349 +1059,6 @@ Make sure to follow redirects to the actual file download URL.
978
1059
  schema: zod.z.void()
979
1060
  }
980
1061
  ]
981
- },
982
- {
983
- method: "patch",
984
- path: "/v2/:id/uploaded-at",
985
- description: `Set the uploaded at timestamp for a file.`,
986
- requestFormat: "json",
987
- parameters: [
988
- {
989
- name: "id",
990
- type: "Path",
991
- schema: zod.z.string()
992
- }
993
- ],
994
- response: zod.z.void()
995
- },
996
- {
997
- method: "post",
998
- path: "/v2/files",
999
- description: `Create a file and get a pre-signed upload URL.
1000
-
1001
- The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
1002
-
1003
- The returned `uploadUrl` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
1004
- `,
1005
- requestFormat: "json",
1006
- parameters: [
1007
- {
1008
- name: "body",
1009
- type: "Body",
1010
- schema: postFiles_Body
1011
- },
1012
- {
1013
- name: "expiresIn",
1014
- type: "Query",
1015
- schema: zod.z.number().optional().default(3600)
1016
- }
1017
- ],
1018
- response: zod.z.object({
1019
- id: zod.z.string(),
1020
- uploadUrl: zod.z.string(),
1021
- expiresAt: zod.z.string().datetime({ offset: true }),
1022
- metadata: zod.z.object({
1023
- id: zod.z.string(),
1024
- path: zod.z.string(),
1025
- workspaceId: zod.z.string(),
1026
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1027
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1028
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1029
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1030
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1031
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1032
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1033
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1034
- createdAt: zod.z.string(),
1035
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1036
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1037
- }),
1038
- path: zod.z.string()
1039
- })
1040
- },
1041
- {
1042
- method: "get",
1043
- path: "/v2/files/:fileId",
1044
- description: `Get a pre-signed download URL for a file.`,
1045
- requestFormat: "json",
1046
- parameters: [
1047
- {
1048
- name: "preserveFileName",
1049
- type: "Query",
1050
- schema: zod.z.enum(["true", "false"]).optional().default("true")
1051
- },
1052
- {
1053
- name: "fileId",
1054
- type: "Path",
1055
- schema: zod.z.string()
1056
- }
1057
- ],
1058
- response: zod.z.object({
1059
- url: zod.z.string(),
1060
- expiresAt: zod.z.string().datetime({ offset: true }),
1061
- metadata: zod.z.union([
1062
- zod.z.object({
1063
- id: zod.z.string(),
1064
- path: zod.z.string(),
1065
- workspaceId: zod.z.string(),
1066
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1067
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1068
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1069
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1070
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1071
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1072
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1073
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1074
- createdAt: zod.z.string(),
1075
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1076
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1077
- }),
1078
- zod.z.null()
1079
- ])
1080
- }),
1081
- errors: [
1082
- {
1083
- status: 404,
1084
- description: `File not found`,
1085
- schema: zod.z.void()
1086
- }
1087
- ]
1088
- },
1089
- {
1090
- method: "post",
1091
- path: "/v2/files/:filename",
1092
- description: `Create a file and get a pre-signed upload URL (legacy endpoint).
1093
-
1094
- This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
1095
-
1096
- The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
1097
-
1098
- The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
1099
- `,
1100
- requestFormat: "json",
1101
- parameters: [
1102
- {
1103
- name: "body",
1104
- type: "Body",
1105
- schema: postFiles_Body
1106
- },
1107
- {
1108
- name: "expiresIn",
1109
- type: "Query",
1110
- schema: zod.z.number().optional().default(3600)
1111
- },
1112
- {
1113
- name: "filename",
1114
- type: "Path",
1115
- schema: zod.z.string()
1116
- }
1117
- ],
1118
- response: zod.z.object({
1119
- url: zod.z.string(),
1120
- expiresAt: zod.z.string().datetime({ offset: true })
1121
- })
1122
- },
1123
- {
1124
- method: "put",
1125
- path: "/v2/files/:id",
1126
- description: `Create a file and get a pre-signed upload URL.`,
1127
- requestFormat: "json",
1128
- parameters: [
1129
- {
1130
- name: "expiresIn",
1131
- type: "Query",
1132
- schema: zod.z.number().optional().default(3600)
1133
- },
1134
- {
1135
- name: "id",
1136
- type: "Path",
1137
- schema: zod.z.string()
1138
- }
1139
- ],
1140
- response: zod.z.union([
1141
- zod.z.object({
1142
- id: zod.z.string(),
1143
- uploadUrl: zod.z.string().url(),
1144
- expiresAt: zod.z.string().datetime({ offset: true }),
1145
- metadata: zod.z.object({
1146
- id: zod.z.string(),
1147
- path: zod.z.string(),
1148
- workspaceId: zod.z.string(),
1149
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1150
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1151
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1152
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1153
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1154
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1155
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1156
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1157
- createdAt: zod.z.string(),
1158
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1159
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1160
- })
1161
- }),
1162
- zod.z.object({
1163
- url: zod.z.string().url(),
1164
- expiresAt: zod.z.string().datetime({ offset: true })
1165
- })
1166
- ])
1167
- },
1168
- {
1169
- method: "delete",
1170
- path: "/v2/files/:id",
1171
- description: `Delete a file.`,
1172
- requestFormat: "json",
1173
- parameters: [
1174
- {
1175
- name: "id",
1176
- type: "Path",
1177
- schema: zod.z.string()
1178
- }
1179
- ],
1180
- response: zod.z.void()
1181
- },
1182
- {
1183
- method: "get",
1184
- path: "/v2/files/:id/metadata",
1185
- description: `Get the metadata for a file.`,
1186
- requestFormat: "json",
1187
- parameters: [
1188
- {
1189
- name: "id",
1190
- type: "Path",
1191
- schema: zod.z.string()
1192
- }
1193
- ],
1194
- response: zod.z.object({
1195
- id: zod.z.string(),
1196
- path: zod.z.string(),
1197
- workspaceId: zod.z.string(),
1198
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1199
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1200
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1201
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1202
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1203
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1204
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1205
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1206
- createdAt: zod.z.string(),
1207
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1208
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1209
- }),
1210
- errors: [
1211
- {
1212
- status: 404,
1213
- description: `File not found`,
1214
- schema: zod.z.void()
1215
- }
1216
- ]
1217
- },
1218
- {
1219
- method: "get",
1220
- path: "/v2/files/:parentId/children",
1221
- description: `Get the children of a file.`,
1222
- requestFormat: "json",
1223
- parameters: [
1224
- {
1225
- name: "mimeType",
1226
- type: "Query",
1227
- schema: zod.z.string().optional()
1228
- },
1229
- {
1230
- name: "includeDeleted",
1231
- type: "Query",
1232
- schema: zod.z.enum(["true", "false"]).optional().default("false")
1233
- },
1234
- {
1235
- name: "limit",
1236
- type: "Query",
1237
- schema: zod.z.number().optional().default(100)
1238
- },
1239
- {
1240
- name: "offset",
1241
- type: "Query",
1242
- schema: zod.z.number().optional().default(0)
1243
- },
1244
- {
1245
- name: "parentId",
1246
- type: "Path",
1247
- schema: zod.z.string()
1248
- }
1249
- ],
1250
- response: zod.z.object({
1251
- files: zod.z.array(
1252
- zod.z.object({
1253
- id: zod.z.string(),
1254
- path: zod.z.string(),
1255
- workspaceId: zod.z.string(),
1256
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1257
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1258
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1259
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1260
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1261
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1262
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1263
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1264
- createdAt: zod.z.string(),
1265
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1266
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1267
- })
1268
- ),
1269
- count: zod.z.number()
1270
- })
1271
- },
1272
- {
1273
- method: "post",
1274
- path: "/v2/files/bulk",
1275
- description: `Create multiple files in bulk and get pre-signed upload URLs.`,
1276
- requestFormat: "json",
1277
- parameters: [
1278
- {
1279
- name: "body",
1280
- type: "Body",
1281
- schema: postFilesBulk_Body
1282
- }
1283
- ],
1284
- response: zod.z.union([
1285
- zod.z.array(
1286
- zod.z.object({
1287
- id: zod.z.string(),
1288
- path: zod.z.string(),
1289
- workspaceId: zod.z.string(),
1290
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1291
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1292
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1293
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1294
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1295
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1296
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1297
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1298
- createdAt: zod.z.string(),
1299
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1300
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1301
- })
1302
- ),
1303
- zod.z.object({
1304
- files: zod.z.array(
1305
- zod.z.object({
1306
- id: zod.z.string(),
1307
- path: zod.z.string(),
1308
- workspaceId: zod.z.string(),
1309
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1310
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1311
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1312
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1313
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1314
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1315
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1316
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1317
- createdAt: zod.z.string(),
1318
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1319
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
1320
- })
1321
- )
1322
- })
1323
- ])
1324
1062
  }
1325
1063
  ]);
1326
1064
  new core.Zodios(endpoints);
@@ -1328,17 +1066,22 @@ function createApiClient(baseUrl, options) {
1328
1066
  return new core.Zodios(baseUrl, endpoints, options);
1329
1067
  }
1330
1068
 
1069
+ const version = "2.14.0";
1070
+ const packageInfo = {
1071
+ version: version};
1072
+
1073
+ const serviceName = process.env.SERVICE_NAME;
1074
+ const userAgent = `vault-http-client:${packageInfo.version}${serviceName ? `@${serviceName}` : ""}`.trim();
1331
1075
  function useVaultClient(vaultUrl, token) {
1332
1076
  const api = createApiClient(vaultUrl, {
1333
1077
  axiosConfig: {
1334
1078
  headers: {
1335
1079
  "Authorization": token,
1336
- "User-Agent": "vault-http-client:2.9.0"
1080
+ "User-Agent": userAgent
1337
1081
  }
1338
1082
  }
1339
1083
  });
1340
1084
  return api;
1341
1085
  }
1342
1086
 
1343
- exports.createApiClient = createApiClient;
1344
1087
  exports.useVaultClient = useVaultClient;