@fern-api/venus-api-sdk 0.0.18 → 0.0.20

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 (80) hide show
  1. package/core.d.ts +1 -0
  2. package/dist/browser/cjs/core.js +702 -167
  3. package/dist/browser/cjs/index.js +996 -391
  4. package/dist/browser/cjs/serialization.js +930 -329
  5. package/dist/browser/esm/core.js +702 -167
  6. package/dist/browser/esm/index.js +996 -391
  7. package/dist/browser/esm/serialization.js +936 -329
  8. package/dist/node/core.js +702 -167
  9. package/dist/node/index.js +996 -391
  10. package/dist/node/serialization.js +1002 -391
  11. package/package.json +2 -2
  12. package/serialization.d.ts +1 -0
  13. package/types/api/resources/organization/client/Client.d.ts +6 -6
  14. package/types/api/resources/organization/client/addUser.d.ts +0 -1
  15. package/types/api/resources/organization/client/create.d.ts +0 -1
  16. package/types/api/resources/organization/client/get.d.ts +0 -1
  17. package/types/api/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -1
  18. package/types/api/resources/organization/client/isMember.d.ts +0 -1
  19. package/types/api/resources/organization/client/update.d.ts +0 -1
  20. package/types/api/resources/registry/client/Client.d.ts +3 -3
  21. package/types/api/resources/registry/client/generateRegistryTokens.d.ts +0 -1
  22. package/types/api/resources/registry/client/hasRegistryPermission.d.ts +0 -1
  23. package/types/api/resources/registry/client/revokeToken.d.ts +0 -1
  24. package/types/api/resources/user/client/Client.d.ts +2 -2
  25. package/types/api/resources/user/client/getMyOrganizations.d.ts +0 -1
  26. package/types/api/resources/user/client/getMyself.d.ts +0 -1
  27. package/types/core/fetcher/Fetcher.d.ts +1 -1
  28. package/types/core/schemas/Schema.d.ts +35 -7
  29. package/types/core/schemas/builders/enum/enum.d.ts +1 -1
  30. package/types/core/schemas/builders/index.d.ts +0 -1
  31. package/types/core/schemas/builders/literals/stringLiteral.d.ts +1 -1
  32. package/types/core/schemas/builders/object/types.d.ts +5 -4
  33. package/types/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +4 -3
  34. package/types/core/schemas/builders/object-like/index.d.ts +2 -2
  35. package/types/core/schemas/builders/object-like/types.d.ts +2 -8
  36. package/types/core/schemas/builders/primitives/any.d.ts +1 -1
  37. package/types/core/schemas/builders/primitives/boolean.d.ts +1 -1
  38. package/types/core/schemas/builders/primitives/number.d.ts +1 -1
  39. package/types/core/schemas/builders/primitives/string.d.ts +1 -1
  40. package/types/core/schemas/builders/primitives/unknown.d.ts +1 -1
  41. package/types/core/schemas/builders/record/index.d.ts +1 -0
  42. package/types/core/schemas/builders/record/record.d.ts +2 -1
  43. package/types/core/schemas/builders/record/types.d.ts +5 -0
  44. package/types/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  45. package/types/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  46. package/types/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +11 -6
  47. package/types/core/schemas/builders/schema-utils/index.d.ts +2 -1
  48. package/types/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  49. package/types/core/schemas/utils/MaybePromise.d.ts +1 -0
  50. package/types/core/schemas/utils/OptionalRecord.d.ts +1 -0
  51. package/types/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
  52. package/types/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  53. package/types/core/schemas/utils/isPlainObject.d.ts +2 -0
  54. package/types/serialization/resources/index.d.ts +2 -0
  55. package/types/serialization/resources/organization/client/addUser.d.ts +0 -7
  56. package/types/serialization/resources/organization/client/create.d.ts +0 -7
  57. package/types/serialization/resources/organization/client/get.d.ts +0 -4
  58. package/types/serialization/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -4
  59. package/types/serialization/resources/organization/client/index.d.ts +1 -0
  60. package/types/serialization/resources/organization/client/requests/AddUserToOrgRequest.d.ts +13 -0
  61. package/types/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts +13 -0
  62. package/types/serialization/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +12 -0
  63. package/types/serialization/resources/organization/client/requests/index.d.ts +3 -0
  64. package/types/serialization/resources/organization/client/update.d.ts +0 -6
  65. package/types/serialization/resources/registry/client/generateRegistryTokens.d.ts +0 -10
  66. package/types/serialization/resources/registry/client/hasRegistryPermission.d.ts +1 -8
  67. package/types/serialization/resources/registry/client/index.d.ts +1 -0
  68. package/types/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +13 -0
  69. package/types/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +12 -0
  70. package/types/serialization/resources/registry/client/requests/RevokeTokenRequest.d.ts +13 -0
  71. package/types/serialization/resources/registry/client/requests/index.d.ts +3 -0
  72. package/types/serialization/resources/registry/client/revokeToken.d.ts +0 -7
  73. package/types/serialization/resources/user/index.d.ts +0 -1
  74. package/types/core/schemas/builders/identity/createIdentitySchemaCreator.d.ts +0 -2
  75. package/types/core/schemas/builders/identity/identity.d.ts +0 -2
  76. package/types/core/schemas/builders/identity/index.d.ts +0 -2
  77. package/types/core/schemas/builders/schema-utils/types.d.ts +0 -7
  78. package/types/serialization/resources/user/client/getMyOrganizations.d.ts +0 -10
  79. package/types/serialization/resources/user/client/getMyself.d.ts +0 -10
  80. package/types/serialization/resources/user/client/index.d.ts +0 -2
@@ -810,12 +810,72 @@ var init_api = __esm({
810
810
  }
811
811
  });
812
812
 
813
- // src/core/schemas/builders/schema-utils/types.ts
814
- var OPTIONAL_BRAND;
815
- var init_types5 = __esm({
816
- "src/core/schemas/builders/schema-utils/types.ts"() {
813
+ // src/core/schemas/Schema.ts
814
+ var SchemaType;
815
+ var init_Schema = __esm({
816
+ "src/core/schemas/Schema.ts"() {
817
+ "use strict";
818
+ SchemaType = {
819
+ DATE: "date",
820
+ ENUM: "enum",
821
+ LIST: "list",
822
+ STRING_LITERAL: "stringLiteral",
823
+ OBJECT: "object",
824
+ ANY: "any",
825
+ BOOLEAN: "boolean",
826
+ NUMBER: "number",
827
+ STRING: "string",
828
+ UNKNOWN: "unknown",
829
+ RECORD: "record",
830
+ SET: "set",
831
+ UNION: "union",
832
+ OPTIONAL: "optional"
833
+ };
834
+ }
835
+ });
836
+
837
+ // src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts
838
+ function stringifyValidationError(error) {
839
+ if (error.path.length === 0) {
840
+ return error.message;
841
+ }
842
+ return `${error.path.join(" -> ")}: ${error.message}`;
843
+ }
844
+ var init_stringifyValidationErrors = __esm({
845
+ "src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts"() {
846
+ "use strict";
847
+ }
848
+ });
849
+
850
+ // src/core/schemas/builders/schema-utils/JsonError.ts
851
+ var JsonError;
852
+ var init_JsonError = __esm({
853
+ "src/core/schemas/builders/schema-utils/JsonError.ts"() {
854
+ "use strict";
855
+ init_stringifyValidationErrors();
856
+ JsonError = class extends Error {
857
+ constructor(errors) {
858
+ super(errors.map(stringifyValidationError).join("; "));
859
+ this.errors = errors;
860
+ Object.setPrototypeOf(this, JsonError.prototype);
861
+ }
862
+ };
863
+ }
864
+ });
865
+
866
+ // src/core/schemas/builders/schema-utils/ParseError.ts
867
+ var ParseError;
868
+ var init_ParseError = __esm({
869
+ "src/core/schemas/builders/schema-utils/ParseError.ts"() {
817
870
  "use strict";
818
- OPTIONAL_BRAND = void 0;
871
+ init_stringifyValidationErrors();
872
+ ParseError = class extends Error {
873
+ constructor(errors) {
874
+ super(errors.map(stringifyValidationError).join("; "));
875
+ this.errors = errors;
876
+ Object.setPrototypeOf(this, ParseError.prototype);
877
+ }
878
+ };
819
879
  }
820
880
  });
821
881
 
@@ -823,16 +883,46 @@ var init_types5 = __esm({
823
883
  function getSchemaUtils(schema) {
824
884
  return {
825
885
  optional: () => optional(schema),
826
- transform: (transformer) => transform(schema, transformer)
886
+ transform: (transformer) => transform(schema, transformer),
887
+ parseOrThrow: async (raw, opts) => {
888
+ const parsed = await schema.parse(raw, opts);
889
+ if (parsed.ok) {
890
+ return parsed.value;
891
+ }
892
+ throw new ParseError(parsed.errors);
893
+ },
894
+ jsonOrThrow: async (parsed, opts) => {
895
+ const raw = await schema.json(parsed, opts);
896
+ if (raw.ok) {
897
+ return raw.value;
898
+ }
899
+ throw new JsonError(raw.errors);
900
+ }
827
901
  };
828
902
  }
829
903
  function optional(schema) {
830
904
  const baseSchema = {
831
- parse: (raw, opts) => raw != null ? schema.parse(raw, opts) : void 0,
832
- json: (parsed, opts) => parsed != null ? schema.json(parsed, opts) : void 0
905
+ parse: (raw, opts) => {
906
+ if (raw == null) {
907
+ return {
908
+ ok: true,
909
+ value: void 0
910
+ };
911
+ }
912
+ return schema.parse(raw, opts);
913
+ },
914
+ json: (parsed, opts) => {
915
+ if (parsed == null) {
916
+ return {
917
+ ok: true,
918
+ value: null
919
+ };
920
+ }
921
+ return schema.json(parsed, opts);
922
+ },
923
+ getType: () => SchemaType.OPTIONAL
833
924
  };
834
925
  return {
835
- ...OPTIONAL_BRAND,
836
926
  ...baseSchema,
837
927
  ...getSchemaUtils(baseSchema)
838
928
  };
@@ -840,13 +930,20 @@ function optional(schema) {
840
930
  function transform(schema, transformer) {
841
931
  const baseSchema = {
842
932
  parse: async (raw, opts) => {
843
- const postTransformParsed = await schema.parse(raw, opts);
844
- return transformer.parse(postTransformParsed, opts);
933
+ const parsed = await schema.parse(raw, opts);
934
+ if (!parsed.ok) {
935
+ return parsed;
936
+ }
937
+ return {
938
+ ok: true,
939
+ value: transformer.transform(parsed.value)
940
+ };
845
941
  },
846
- json: async (parsed, opts) => {
847
- const preTransformParsed = await transformer.json(parsed, opts);
848
- return schema.json(preTransformParsed, opts);
849
- }
942
+ json: async (transformed, opts) => {
943
+ const parsed = await transformer.untransform(transformed);
944
+ return schema.json(parsed, opts);
945
+ },
946
+ getType: () => schema.getType()
850
947
  };
851
948
  return {
852
949
  ...baseSchema,
@@ -856,7 +953,9 @@ function transform(schema, transformer) {
856
953
  var init_getSchemaUtils = __esm({
857
954
  "src/core/schemas/builders/schema-utils/getSchemaUtils.ts"() {
858
955
  "use strict";
859
- init_types5();
956
+ init_Schema();
957
+ init_JsonError();
958
+ init_ParseError();
860
959
  }
861
960
  });
862
961
 
@@ -865,25 +964,64 @@ var init_schema_utils = __esm({
865
964
  "src/core/schemas/builders/schema-utils/index.ts"() {
866
965
  "use strict";
867
966
  init_getSchemaUtils();
868
- init_types5();
967
+ init_JsonError();
968
+ init_ParseError();
869
969
  }
870
970
  });
871
971
 
872
972
  // src/core/schemas/builders/date/date.ts
873
973
  function date() {
874
974
  const baseSchema = {
875
- parse: (raw) => new Date(raw),
876
- json: (date2) => date2.toISOString()
975
+ parse: (raw) => {
976
+ if (typeof raw === "string" && ISO_8601_REGEX.test(raw)) {
977
+ return {
978
+ ok: true,
979
+ value: new Date(raw)
980
+ };
981
+ } else {
982
+ return {
983
+ ok: false,
984
+ errors: [
985
+ {
986
+ path: [],
987
+ message: "Not an ISO 8601 date string"
988
+ }
989
+ ]
990
+ };
991
+ }
992
+ },
993
+ json: (date2) => {
994
+ if (date2 instanceof Date) {
995
+ return {
996
+ ok: true,
997
+ value: date2.toISOString()
998
+ };
999
+ } else {
1000
+ return {
1001
+ ok: false,
1002
+ errors: [
1003
+ {
1004
+ path: [],
1005
+ message: "Not a Date object"
1006
+ }
1007
+ ]
1008
+ };
1009
+ }
1010
+ },
1011
+ getType: () => SchemaType.DATE
877
1012
  };
878
1013
  return {
879
1014
  ...baseSchema,
880
1015
  ...getSchemaUtils(baseSchema)
881
1016
  };
882
1017
  }
1018
+ var ISO_8601_REGEX;
883
1019
  var init_date = __esm({
884
1020
  "src/core/schemas/builders/date/date.ts"() {
885
1021
  "use strict";
1022
+ init_Schema();
886
1023
  init_schema_utils();
1024
+ ISO_8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
887
1025
  }
888
1026
  });
889
1027
 
@@ -895,52 +1033,55 @@ var init_date2 = __esm({
895
1033
  }
896
1034
  });
897
1035
 
898
- // src/core/schemas/builders/identity/identity.ts
899
- function identity() {
900
- const baseSchema = {
901
- parse: (raw) => raw,
902
- json: (parsed) => parsed
903
- };
904
- return {
905
- ...baseSchema,
906
- ...getSchemaUtils(baseSchema)
1036
+ // src/core/schemas/utils/createIdentitySchemaCreator.ts
1037
+ function createIdentitySchemaCreator(schemaType, validate) {
1038
+ return () => {
1039
+ const baseSchema = {
1040
+ parse: validate,
1041
+ json: validate,
1042
+ getType: () => schemaType
1043
+ };
1044
+ return {
1045
+ ...baseSchema,
1046
+ ...getSchemaUtils(baseSchema)
1047
+ };
907
1048
  };
908
1049
  }
909
- var init_identity = __esm({
910
- "src/core/schemas/builders/identity/identity.ts"() {
911
- "use strict";
912
- init_schema_utils();
913
- }
914
- });
915
-
916
- // src/core/schemas/builders/identity/createIdentitySchemaCreator.ts
917
- function createIdentitySchemaCreator() {
918
- return () => identity();
919
- }
920
1050
  var init_createIdentitySchemaCreator = __esm({
921
- "src/core/schemas/builders/identity/createIdentitySchemaCreator.ts"() {
922
- "use strict";
923
- init_identity();
924
- }
925
- });
926
-
927
- // src/core/schemas/builders/identity/index.ts
928
- var init_identity2 = __esm({
929
- "src/core/schemas/builders/identity/index.ts"() {
1051
+ "src/core/schemas/utils/createIdentitySchemaCreator.ts"() {
930
1052
  "use strict";
931
- init_createIdentitySchemaCreator();
932
- init_identity();
1053
+ init_schema_utils();
933
1054
  }
934
1055
  });
935
1056
 
936
1057
  // src/core/schemas/builders/enum/enum.ts
937
- function enum_(_values) {
938
- return createIdentitySchemaCreator()();
1058
+ function enum_(values) {
1059
+ const validValues = new Set(values);
1060
+ const schemaCreator = createIdentitySchemaCreator(SchemaType.ENUM, (value, { allowUnknownKeys = false } = {}) => {
1061
+ if (typeof value === "string" && (validValues.has(value) || allowUnknownKeys)) {
1062
+ return {
1063
+ ok: true,
1064
+ value
1065
+ };
1066
+ } else {
1067
+ return {
1068
+ ok: false,
1069
+ errors: [
1070
+ {
1071
+ path: [],
1072
+ message: "Not one of the allowed values"
1073
+ }
1074
+ ]
1075
+ };
1076
+ }
1077
+ });
1078
+ return schemaCreator();
939
1079
  }
940
1080
  var init_enum = __esm({
941
1081
  "src/core/schemas/builders/enum/enum.ts"() {
942
1082
  "use strict";
943
- init_identity2();
1083
+ init_Schema();
1084
+ init_createIdentitySchemaCreator();
944
1085
  }
945
1086
  });
946
1087
 
@@ -962,8 +1103,9 @@ function lazy(getter) {
962
1103
  }
963
1104
  function constructLazyBaseSchema(getter) {
964
1105
  return {
965
- parse: async (raw) => (await getMemoizedSchema(getter)).parse(raw),
966
- json: async (parsed) => (await getMemoizedSchema(getter)).json(parsed)
1106
+ parse: async (raw, opts) => (await getMemoizedSchema(getter)).parse(raw, opts),
1107
+ json: async (parsed, opts) => (await getMemoizedSchema(getter)).json(parsed, opts),
1108
+ getType: async () => (await getMemoizedSchema(getter)).getType()
967
1109
  };
968
1110
  }
969
1111
  async function getMemoizedSchema(getter) {
@@ -1006,6 +1148,28 @@ var init_filterObject = __esm({
1006
1148
  }
1007
1149
  });
1008
1150
 
1151
+ // src/core/schemas/utils/isPlainObject.ts
1152
+ function isPlainObject(value) {
1153
+ if (typeof value !== "object" || value === null) {
1154
+ return false;
1155
+ }
1156
+ if (Object.getPrototypeOf(value) === null) {
1157
+ return true;
1158
+ }
1159
+ let proto = value;
1160
+ while (Object.getPrototypeOf(proto) !== null) {
1161
+ proto = Object.getPrototypeOf(proto);
1162
+ }
1163
+ return Object.getPrototypeOf(value) === proto;
1164
+ }
1165
+ var NOT_AN_OBJECT_ERROR_MESSAGE;
1166
+ var init_isPlainObject = __esm({
1167
+ "src/core/schemas/utils/isPlainObject.ts"() {
1168
+ "use strict";
1169
+ NOT_AN_OBJECT_ERROR_MESSAGE = "Not an object";
1170
+ }
1171
+ });
1172
+
1009
1173
  // src/core/schemas/utils/keys.ts
1010
1174
  function keys(object2) {
1011
1175
  return Object.keys(object2);
@@ -1034,53 +1198,56 @@ var init_partition = __esm({
1034
1198
  }
1035
1199
  });
1036
1200
 
1037
- // src/core/schemas/builders/object-like/types.ts
1038
- var OBJECT_LIKE_BRAND;
1039
- var init_types6 = __esm({
1040
- "src/core/schemas/builders/object-like/types.ts"() {
1041
- "use strict";
1042
- OBJECT_LIKE_BRAND = void 0;
1043
- }
1044
- });
1045
-
1046
1201
  // src/core/schemas/builders/object-like/getObjectLikeUtils.ts
1047
1202
  function getObjectLikeUtils(schema) {
1048
1203
  return {
1049
- withProperties: (properties) => withProperties(schema, properties)
1204
+ withParsedProperties: (properties) => withParsedProperties(schema, properties)
1050
1205
  };
1051
1206
  }
1052
- function withProperties(objectLike, properties) {
1207
+ function withParsedProperties(objectLike, properties) {
1053
1208
  const objectSchema = {
1054
- ...OBJECT_LIKE_BRAND,
1055
1209
  parse: async (raw, opts) => {
1056
1210
  const parsedObject = await objectLike.parse(raw, opts);
1211
+ if (!parsedObject.ok) {
1212
+ return parsedObject;
1213
+ }
1057
1214
  const additionalProperties = Object.entries(properties).reduce(
1058
1215
  (processed, [key, value]) => {
1059
1216
  return {
1060
1217
  ...processed,
1061
- [key]: typeof value === "function" ? value(parsedObject) : value
1218
+ [key]: typeof value === "function" ? value(parsedObject.value) : value
1062
1219
  };
1063
1220
  },
1064
1221
  {}
1065
1222
  );
1066
1223
  return {
1067
- ...parsedObject,
1068
- ...additionalProperties
1224
+ ok: true,
1225
+ value: {
1226
+ ...parsedObject.value,
1227
+ ...additionalProperties
1228
+ }
1069
1229
  };
1070
1230
  },
1071
1231
  json: (parsed, opts) => {
1232
+ if (!isPlainObject(parsed)) {
1233
+ return {
1234
+ ok: false,
1235
+ errors: [
1236
+ {
1237
+ path: [],
1238
+ message: NOT_AN_OBJECT_ERROR_MESSAGE
1239
+ }
1240
+ ]
1241
+ };
1242
+ }
1072
1243
  const addedPropertyKeys = new Set(Object.keys(properties));
1073
- const parsedWithoutAddedProperties = Object.entries(parsed).reduce(
1074
- (filtered, [key, value]) => {
1075
- if (!addedPropertyKeys.has(key)) {
1076
- filtered[key] = value;
1077
- }
1078
- return filtered;
1079
- },
1080
- {}
1244
+ const parsedWithoutAddedProperties = filterObject(
1245
+ parsed,
1246
+ Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key))
1081
1247
  );
1082
1248
  return objectLike.json(parsedWithoutAddedProperties, opts);
1083
- }
1249
+ },
1250
+ getType: () => objectLike.getType()
1084
1251
  };
1085
1252
  return {
1086
1253
  ...objectSchema,
@@ -1091,8 +1258,9 @@ function withProperties(objectLike, properties) {
1091
1258
  var init_getObjectLikeUtils = __esm({
1092
1259
  "src/core/schemas/builders/object-like/getObjectLikeUtils.ts"() {
1093
1260
  "use strict";
1261
+ init_filterObject();
1262
+ init_isPlainObject();
1094
1263
  init_schema_utils();
1095
- init_types6();
1096
1264
  }
1097
1265
  });
1098
1266
 
@@ -1101,7 +1269,6 @@ var init_object_like = __esm({
1101
1269
  "src/core/schemas/builders/object-like/index.ts"() {
1102
1270
  "use strict";
1103
1271
  init_getObjectLikeUtils();
1104
- init_types6();
1105
1272
  }
1106
1273
  });
1107
1274
 
@@ -1125,54 +1292,76 @@ var init_property = __esm({
1125
1292
  // src/core/schemas/builders/object/object.ts
1126
1293
  function object(schemas) {
1127
1294
  const baseSchema = {
1128
- ...OBJECT_LIKE_BRAND,
1129
1295
  _getRawProperties: () => Promise.resolve(
1130
1296
  Object.entries(schemas).map(
1131
1297
  ([parsedKey, propertySchema]) => isProperty(propertySchema) ? propertySchema.rawKey : parsedKey
1132
1298
  )
1133
1299
  ),
1134
1300
  _getParsedProperties: () => Promise.resolve(keys(schemas)),
1135
- parse: async (raw, { skipUnknownKeysOnParse = false } = {}) => {
1301
+ parse: async (raw, opts) => {
1136
1302
  const rawKeyToProperty = {};
1303
+ const requiredKeys = [];
1137
1304
  for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
1138
1305
  const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey;
1306
+ const valueSchema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty;
1139
1307
  const property2 = {
1140
1308
  rawKey,
1141
1309
  parsedKey,
1142
- valueSchema: isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty
1310
+ valueSchema
1143
1311
  };
1144
1312
  rawKeyToProperty[rawKey] = property2;
1145
- }
1146
- const parsed = {};
1147
- for (const [rawKey, rawPropertyValue] of Object.entries(raw)) {
1148
- const property2 = rawKeyToProperty[rawKey];
1149
- if (property2 != null) {
1150
- const value = await property2.valueSchema.parse(rawPropertyValue);
1151
- parsed[property2.parsedKey] = value;
1152
- } else if (!skipUnknownKeysOnParse && rawPropertyValue != null) {
1153
- parsed[rawKey] = rawPropertyValue;
1313
+ if (await valueSchema.getType() !== "optional") {
1314
+ requiredKeys.push(rawKey);
1154
1315
  }
1155
1316
  }
1156
- return parsed;
1317
+ return validateAndTransformObject({
1318
+ value: raw,
1319
+ requiredKeys,
1320
+ getProperty: (rawKey) => {
1321
+ const property2 = rawKeyToProperty[rawKey];
1322
+ if (property2 == null) {
1323
+ return void 0;
1324
+ }
1325
+ return {
1326
+ transformedKey: property2.parsedKey,
1327
+ transform: (propertyValue) => property2.valueSchema.parse(propertyValue, opts)
1328
+ };
1329
+ },
1330
+ allowUnknownKeys: (opts == null ? void 0 : opts.allowUnknownKeys) ?? false
1331
+ });
1157
1332
  },
1158
- json: async (parsed, { includeUnknownKeysOnJson = false } = {}) => {
1159
- const raw = {};
1160
- for (const [parsedKey, parsedPropertyValue] of entries(parsed)) {
1161
- const schemaOrObjectProperty = schemas[parsedKey];
1162
- if (schemaOrObjectProperty != null) {
1163
- if (isProperty(schemaOrObjectProperty)) {
1164
- const value = await schemaOrObjectProperty.valueSchema.json(parsedPropertyValue);
1165
- raw[schemaOrObjectProperty.rawKey] = value;
1333
+ json: async (parsed, opts) => {
1334
+ const requiredKeys = [];
1335
+ for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
1336
+ const valueSchema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty;
1337
+ if (await valueSchema.getType() !== "optional") {
1338
+ requiredKeys.push(parsedKey);
1339
+ }
1340
+ }
1341
+ return validateAndTransformObject({
1342
+ value: parsed,
1343
+ requiredKeys,
1344
+ getProperty: (parsedKey) => {
1345
+ const property2 = schemas[parsedKey];
1346
+ if (property2 == null) {
1347
+ return void 0;
1348
+ }
1349
+ if (isProperty(property2)) {
1350
+ return {
1351
+ transformedKey: property2.rawKey,
1352
+ transform: (propertyValue) => property2.valueSchema.json(propertyValue, opts)
1353
+ };
1166
1354
  } else {
1167
- const value = await schemaOrObjectProperty.json(parsedPropertyValue);
1168
- raw[parsedKey] = value;
1355
+ return {
1356
+ transformedKey: parsedKey,
1357
+ transform: (propertyValue) => property2.json(propertyValue, opts)
1358
+ };
1169
1359
  }
1170
- } else if (includeUnknownKeysOnJson && parsedPropertyValue != null) {
1171
- raw[parsedKey] = parsedPropertyValue;
1172
- }
1173
- }
1174
- return raw;
1175
- }
1360
+ },
1361
+ allowUnknownKeys: (opts == null ? void 0 : opts.allowUnknownKeys) ?? false
1362
+ });
1363
+ },
1364
+ getType: () => SchemaType.OBJECT
1176
1365
  };
1177
1366
  return {
1178
1367
  ...baseSchema,
@@ -1181,11 +1370,72 @@ function object(schemas) {
1181
1370
  ...getObjectUtils(baseSchema)
1182
1371
  };
1183
1372
  }
1373
+ async function validateAndTransformObject({
1374
+ value,
1375
+ requiredKeys,
1376
+ getProperty,
1377
+ allowUnknownKeys
1378
+ }) {
1379
+ if (!isPlainObject(value)) {
1380
+ return {
1381
+ ok: false,
1382
+ errors: [
1383
+ {
1384
+ path: [],
1385
+ message: NOT_AN_OBJECT_ERROR_MESSAGE
1386
+ }
1387
+ ]
1388
+ };
1389
+ }
1390
+ const missingRequiredKeys = new Set(requiredKeys);
1391
+ const errors = [];
1392
+ const transformed = {};
1393
+ for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) {
1394
+ const property2 = getProperty(preTransformedKey);
1395
+ if (property2 != null) {
1396
+ missingRequiredKeys.delete(preTransformedKey);
1397
+ const value2 = await property2.transform(preTransformedItemValue);
1398
+ if (value2.ok) {
1399
+ transformed[property2.transformedKey] = value2.value;
1400
+ } else {
1401
+ errors.push(
1402
+ ...value2.errors.map((error) => ({
1403
+ path: [preTransformedKey, ...error.path],
1404
+ message: error.message
1405
+ }))
1406
+ );
1407
+ }
1408
+ } else if (allowUnknownKeys) {
1409
+ transformed[preTransformedKey] = preTransformedItemValue;
1410
+ } else {
1411
+ errors.push({
1412
+ path: [preTransformedKey],
1413
+ message: `Unrecognized key "${preTransformedKey}"`
1414
+ });
1415
+ }
1416
+ }
1417
+ errors.push(
1418
+ ...requiredKeys.filter((key) => missingRequiredKeys.has(key)).map((key) => ({
1419
+ path: [],
1420
+ message: `Missing required key "${key}"`
1421
+ }))
1422
+ );
1423
+ if (errors.length === 0) {
1424
+ return {
1425
+ ok: true,
1426
+ value: transformed
1427
+ };
1428
+ } else {
1429
+ return {
1430
+ ok: false,
1431
+ errors
1432
+ };
1433
+ }
1434
+ }
1184
1435
  function getObjectUtils(schema) {
1185
1436
  return {
1186
1437
  extend: (extension) => {
1187
1438
  const baseSchema = {
1188
- ...OBJECT_LIKE_BRAND,
1189
1439
  _getParsedProperties: async () => [
1190
1440
  ...await schema._getParsedProperties(),
1191
1441
  ...await extension._getParsedProperties()
@@ -1195,27 +1445,22 @@ function getObjectUtils(schema) {
1195
1445
  ...await extension._getRawProperties()
1196
1446
  ],
1197
1447
  parse: async (raw, opts) => {
1198
- const rawExtensionPropertiesSet = new Set(await extension._getRawProperties());
1199
- const [extensionProperties, otherProperties] = partition(
1200
- keys(raw),
1201
- (key) => rawExtensionPropertiesSet.has(key)
1202
- );
1203
- return {
1204
- ...await schema.parse(filterObject(raw, otherProperties), opts),
1205
- ...await extension.parse(filterObject(raw, extensionProperties), opts)
1206
- };
1448
+ return validateAndTransformExtendedObject({
1449
+ extensionKeys: await extension._getRawProperties(),
1450
+ value: raw,
1451
+ transformBase: (rawBase) => schema.parse(rawBase, opts),
1452
+ transformExtension: (rawExtension) => extension.parse(rawExtension, opts)
1453
+ });
1207
1454
  },
1208
1455
  json: async (parsed, opts) => {
1209
- const parsedExtensionPropertiesSet = new Set(await extension._getParsedProperties());
1210
- const [extensionProperties, otherProperties] = partition(
1211
- keys(parsed),
1212
- (key) => parsedExtensionPropertiesSet.has(key)
1213
- );
1214
- return {
1215
- ...await schema.json(filterObject(parsed, otherProperties), opts),
1216
- ...await extension.json(filterObject(parsed, extensionProperties), opts)
1217
- };
1218
- }
1456
+ return validateAndTransformExtendedObject({
1457
+ extensionKeys: await extension._getParsedProperties(),
1458
+ value: parsed,
1459
+ transformBase: (parsedBase) => schema.json(parsedBase, opts),
1460
+ transformExtension: (parsedExtension) => extension.json(parsedExtension, opts)
1461
+ });
1462
+ },
1463
+ getType: () => SchemaType.OBJECT
1219
1464
  };
1220
1465
  return {
1221
1466
  ...baseSchema,
@@ -1226,11 +1471,44 @@ function getObjectUtils(schema) {
1226
1471
  }
1227
1472
  };
1228
1473
  }
1474
+ async function validateAndTransformExtendedObject({
1475
+ extensionKeys,
1476
+ value,
1477
+ transformBase,
1478
+ transformExtension
1479
+ }) {
1480
+ const extensionPropertiesSet = new Set(extensionKeys);
1481
+ const [extensionProperties, baseProperties] = partition(
1482
+ keys(value),
1483
+ (key) => extensionPropertiesSet.has(key)
1484
+ );
1485
+ const transformedBase = await transformBase(filterObject(value, baseProperties));
1486
+ const transformedExtension = await transformExtension(filterObject(value, extensionProperties));
1487
+ if (transformedBase.ok && transformedExtension.ok) {
1488
+ return {
1489
+ ok: true,
1490
+ value: {
1491
+ ...transformedBase.value,
1492
+ ...transformedExtension.value
1493
+ }
1494
+ };
1495
+ } else {
1496
+ return {
1497
+ ok: false,
1498
+ errors: [
1499
+ ...transformedBase.ok ? [] : transformedBase.errors,
1500
+ ...transformedExtension.ok ? [] : transformedExtension.errors
1501
+ ]
1502
+ };
1503
+ }
1504
+ }
1229
1505
  var init_object = __esm({
1230
1506
  "src/core/schemas/builders/object/object.ts"() {
1231
1507
  "use strict";
1508
+ init_Schema();
1232
1509
  init_entries();
1233
1510
  init_filterObject();
1511
+ init_isPlainObject();
1234
1512
  init_keys();
1235
1513
  init_partition();
1236
1514
  init_object_like();
@@ -1251,7 +1529,6 @@ var init_object2 = __esm({
1251
1529
  // src/core/schemas/builders/lazy/lazyObject.ts
1252
1530
  function lazyObject(getter) {
1253
1531
  const baseSchema = {
1254
- ...OBJECT_LIKE_BRAND,
1255
1532
  ...constructLazyBaseSchema(getter),
1256
1533
  _getRawProperties: async () => (await getMemoizedSchema(getter))._getRawProperties(),
1257
1534
  _getParsedProperties: async () => (await getMemoizedSchema(getter))._getParsedProperties()
@@ -1285,17 +1562,60 @@ var init_lazy2 = __esm({
1285
1562
  // src/core/schemas/builders/list/list.ts
1286
1563
  function list(schema) {
1287
1564
  const baseSchema = {
1288
- parse: (raw, opts) => Promise.all(raw.map((item) => schema.parse(item, opts))),
1289
- json: (parsed, opts) => Promise.all(parsed.map((item) => schema.json(item, opts)))
1565
+ parse: async (raw, opts) => validateAndTransformArray(raw, (item) => schema.parse(item, opts)),
1566
+ json: (parsed, opts) => validateAndTransformArray(parsed, (item) => schema.json(item, opts)),
1567
+ getType: () => SchemaType.LIST
1290
1568
  };
1291
1569
  return {
1292
1570
  ...baseSchema,
1293
1571
  ...getSchemaUtils(baseSchema)
1294
1572
  };
1295
1573
  }
1574
+ async function validateAndTransformArray(value, transformItem) {
1575
+ if (!Array.isArray(value)) {
1576
+ return {
1577
+ ok: false,
1578
+ errors: [
1579
+ {
1580
+ message: "Not a list",
1581
+ path: []
1582
+ }
1583
+ ]
1584
+ };
1585
+ }
1586
+ const maybeValidItems = await Promise.all(value.map((item) => transformItem(item)));
1587
+ return maybeValidItems.reduce(
1588
+ (acc, item, index) => {
1589
+ if (acc.ok && item.ok) {
1590
+ return {
1591
+ ok: true,
1592
+ value: [...acc.value, item.value]
1593
+ };
1594
+ }
1595
+ const errors = [];
1596
+ if (!acc.ok) {
1597
+ errors.push(...acc.errors);
1598
+ }
1599
+ if (!item.ok) {
1600
+ errors.push(
1601
+ ...item.errors.map((error) => ({
1602
+ path: [`[${index}]`, ...error.path],
1603
+ message: error.message
1604
+ }))
1605
+ );
1606
+ }
1607
+ return {
1608
+ ok: false,
1609
+ errors
1610
+ };
1611
+ },
1612
+ { ok: true, value: [] }
1613
+ );
1614
+ }
1296
1615
  var init_list = __esm({
1297
1616
  "src/core/schemas/builders/list/list.ts"() {
1298
1617
  "use strict";
1618
+ init_Schema();
1299
1619
  init_schema_utils();
1300
1620
  }
1301
1621
  });
@@ -1309,13 +1629,32 @@ var init_list2 = __esm({
1309
1629
  });
1310
1630
 
1311
1631
  // src/core/schemas/builders/literals/stringLiteral.ts
1312
- function stringLiteral(_value) {
1313
- return createIdentitySchemaCreator()();
1632
+ function stringLiteral(literal) {
1633
+ const schemaCreator = createIdentitySchemaCreator(SchemaType.STRING_LITERAL, (value) => {
1634
+ if (value === literal) {
1635
+ return {
1636
+ ok: true,
1637
+ value: literal
1638
+ };
1639
+ } else {
1640
+ return {
1641
+ ok: false,
1642
+ errors: [
1643
+ {
1644
+ path: [],
1645
+ message: `Not equal to "${literal}"`
1646
+ }
1647
+ ]
1648
+ };
1649
+ }
1650
+ });
1651
+ return schemaCreator();
1314
1652
  }
1315
1653
  var init_stringLiteral = __esm({
1316
1654
  "src/core/schemas/builders/literals/stringLiteral.ts"() {
1317
1655
  "use strict";
1318
- init_identity2();
1656
+ init_Schema();
1657
+ init_createIdentitySchemaCreator();
1319
1658
  }
1320
1659
  });
1321
1660
 
@@ -1332,8 +1671,9 @@ var any;
1332
1671
  var init_any = __esm({
1333
1672
  "src/core/schemas/builders/primitives/any.ts"() {
1334
1673
  "use strict";
1335
- init_identity2();
1336
- any = createIdentitySchemaCreator();
1674
+ init_Schema();
1675
+ init_createIdentitySchemaCreator();
1676
+ any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value }));
1337
1677
  }
1338
1678
  });
1339
1679
 
@@ -1342,8 +1682,26 @@ var boolean;
1342
1682
  var init_boolean = __esm({
1343
1683
  "src/core/schemas/builders/primitives/boolean.ts"() {
1344
1684
  "use strict";
1345
- init_identity2();
1346
- boolean = createIdentitySchemaCreator();
1685
+ init_Schema();
1686
+ init_createIdentitySchemaCreator();
1687
+ boolean = createIdentitySchemaCreator(SchemaType.BOOLEAN, (value) => {
1688
+ if (typeof value === "boolean") {
1689
+ return {
1690
+ ok: true,
1691
+ value
1692
+ };
1693
+ } else {
1694
+ return {
1695
+ ok: false,
1696
+ errors: [
1697
+ {
1698
+ path: [],
1699
+ message: "Not a boolean"
1700
+ }
1701
+ ]
1702
+ };
1703
+ }
1704
+ });
1347
1705
  }
1348
1706
  });
1349
1707
 
@@ -1352,8 +1710,26 @@ var number;
1352
1710
  var init_number = __esm({
1353
1711
  "src/core/schemas/builders/primitives/number.ts"() {
1354
1712
  "use strict";
1355
- init_identity2();
1356
- number = createIdentitySchemaCreator();
1713
+ init_Schema();
1714
+ init_createIdentitySchemaCreator();
1715
+ number = createIdentitySchemaCreator(SchemaType.NUMBER, (value) => {
1716
+ if (typeof value === "number") {
1717
+ return {
1718
+ ok: true,
1719
+ value
1720
+ };
1721
+ } else {
1722
+ return {
1723
+ ok: false,
1724
+ errors: [
1725
+ {
1726
+ path: [],
1727
+ message: "Not a number"
1728
+ }
1729
+ ]
1730
+ };
1731
+ }
1732
+ });
1357
1733
  }
1358
1734
  });
1359
1735
 
@@ -1362,8 +1738,26 @@ var string;
1362
1738
  var init_string = __esm({
1363
1739
  "src/core/schemas/builders/primitives/string.ts"() {
1364
1740
  "use strict";
1365
- init_identity2();
1366
- string = createIdentitySchemaCreator();
1741
+ init_Schema();
1742
+ init_createIdentitySchemaCreator();
1743
+ string = createIdentitySchemaCreator(SchemaType.STRING, (value) => {
1744
+ if (typeof value === "string") {
1745
+ return {
1746
+ ok: true,
1747
+ value
1748
+ };
1749
+ } else {
1750
+ return {
1751
+ ok: false,
1752
+ errors: [
1753
+ {
1754
+ path: [],
1755
+ message: "Not a string"
1756
+ }
1757
+ ]
1758
+ };
1759
+ }
1760
+ });
1367
1761
  }
1368
1762
  });
1369
1763
 
@@ -1372,8 +1766,9 @@ var unknown;
1372
1766
  var init_unknown = __esm({
1373
1767
  "src/core/schemas/builders/primitives/unknown.ts"() {
1374
1768
  "use strict";
1375
- init_identity2();
1376
- unknown = createIdentitySchemaCreator();
1769
+ init_Schema();
1770
+ init_createIdentitySchemaCreator();
1771
+ unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value }));
1377
1772
  }
1378
1773
  });
1379
1774
 
@@ -1392,32 +1787,104 @@ var init_primitives = __esm({
1392
1787
  // src/core/schemas/builders/record/record.ts
1393
1788
  function record(keySchema, valueSchema) {
1394
1789
  const baseSchema = {
1395
- parse: (raw, opts) => {
1396
- return entries(raw).reduce(async (parsedPromise, [key, value]) => {
1397
- const parsed = await parsedPromise;
1398
- const parsedKey = await keySchema.parse(key, opts);
1399
- parsed[parsedKey] = await valueSchema.parse(value, opts);
1400
- return parsedPromise;
1401
- }, Promise.resolve({}));
1790
+ parse: async (raw, opts) => {
1791
+ return validateAndTransformRecord({
1792
+ value: raw,
1793
+ isKeyNumeric: await keySchema.getType() === SchemaType.NUMBER,
1794
+ transformKey: (key) => keySchema.parse(key, opts),
1795
+ transformValue: (value) => valueSchema.parse(value, opts)
1796
+ });
1402
1797
  },
1403
- json: (parsed, opts) => {
1404
- return entries(parsed).reduce(async (rawPromise, [key, value]) => {
1405
- const raw = await rawPromise;
1406
- const rawKey = await keySchema.json(key, opts);
1407
- raw[rawKey] = await valueSchema.json(value, opts);
1408
- return rawPromise;
1409
- }, Promise.resolve({}));
1410
- }
1798
+ json: async (parsed, opts) => {
1799
+ return validateAndTransformRecord({
1800
+ value: parsed,
1801
+ isKeyNumeric: await keySchema.getType() === SchemaType.NUMBER,
1802
+ transformKey: (key) => keySchema.json(key, opts),
1803
+ transformValue: (value) => valueSchema.json(value, opts)
1804
+ });
1805
+ },
1806
+ getType: () => SchemaType.RECORD
1411
1807
  };
1412
1808
  return {
1413
1809
  ...baseSchema,
1414
1810
  ...getSchemaUtils(baseSchema)
1415
1811
  };
1416
1812
  }
1813
+ async function validateAndTransformRecord({
1814
+ value,
1815
+ isKeyNumeric,
1816
+ transformKey,
1817
+ transformValue
1818
+ }) {
1819
+ if (!isPlainObject(value)) {
1820
+ return {
1821
+ ok: false,
1822
+ errors: [
1823
+ {
1824
+ path: [],
1825
+ message: NOT_AN_OBJECT_ERROR_MESSAGE
1826
+ }
1827
+ ]
1828
+ };
1829
+ }
1830
+ return entries(value).reduce(
1831
+ async (accPromise, [stringKey, value2]) => {
1832
+ if (value2 == null) {
1833
+ return accPromise;
1834
+ }
1835
+ const acc = await accPromise;
1836
+ let key = stringKey;
1837
+ if (isKeyNumeric) {
1838
+ const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
1839
+ if (!isNaN(numberKey)) {
1840
+ key = numberKey;
1841
+ }
1842
+ }
1843
+ const transformedKey = await transformKey(key);
1844
+ const transformedValue = await transformValue(value2);
1845
+ if (acc.ok && transformedKey.ok && transformedValue.ok) {
1846
+ return {
1847
+ ok: true,
1848
+ value: {
1849
+ ...acc.value,
1850
+ [transformedKey.value]: transformedValue.value
1851
+ }
1852
+ };
1853
+ }
1854
+ const errors = [];
1855
+ if (!acc.ok) {
1856
+ errors.push(...acc.errors);
1857
+ }
1858
+ if (!transformedKey.ok) {
1859
+ errors.push(
1860
+ ...transformedKey.errors.map((error) => ({
1861
+ path: [`${key} (key)`, ...error.path],
1862
+ message: error.message
1863
+ }))
1864
+ );
1865
+ }
1866
+ if (!transformedValue.ok) {
1867
+ errors.push(
1868
+ ...transformedValue.errors.map((error) => ({
1869
+ path: [stringKey, ...error.path],
1870
+ message: error.message
1871
+ }))
1872
+ );
1873
+ }
1874
+ return {
1875
+ ok: false,
1876
+ errors
1877
+ };
1878
+ },
1879
+ Promise.resolve({ ok: true, value: {} })
1880
+ );
1881
+ }
1417
1882
  var init_record = __esm({
1418
1883
  "src/core/schemas/builders/record/record.ts"() {
1419
1884
  "use strict";
1885
+ init_Schema();
1420
1886
  init_entries();
1887
+ init_isPlainObject();
1421
1888
  init_schema_utils();
1422
1889
  }
1423
1890
  });
@@ -1432,9 +1899,35 @@ var init_record2 = __esm({
1432
1899
 
1433
1900
  // src/core/schemas/builders/set/set.ts
1434
1901
  function set(schema) {
1902
+ const listSchema = list(schema);
1435
1903
  const baseSchema = {
1436
- parse: async (raw, opts) => new Set(await Promise.all(raw.map((item) => schema.parse(item, opts)))),
1437
- json: (parsed, opts) => Promise.all([...parsed].map((item) => schema.json(item, opts)))
1904
+ parse: async (raw, opts) => {
1905
+ const parsedList = await listSchema.parse(raw, opts);
1906
+ if (parsedList.ok) {
1907
+ return {
1908
+ ok: true,
1909
+ value: new Set(parsedList.value)
1910
+ };
1911
+ } else {
1912
+ return parsedList;
1913
+ }
1914
+ },
1915
+ json: async (parsed, opts) => {
1916
+ if (!(parsed instanceof Set)) {
1917
+ return {
1918
+ ok: false,
1919
+ errors: [
1920
+ {
1921
+ path: [],
1922
+ message: "Not a Set"
1923
+ }
1924
+ ]
1925
+ };
1926
+ }
1927
+ const jsonList = await listSchema.json([...parsed], opts);
1928
+ return jsonList;
1929
+ },
1930
+ getType: () => SchemaType.SET
1438
1931
  };
1439
1932
  return {
1440
1933
  ...baseSchema,
@@ -1444,6 +1937,8 @@ function set(schema) {
1444
1937
  var init_set = __esm({
1445
1938
  "src/core/schemas/builders/set/set.ts"() {
1446
1939
  "use strict";
1940
+ init_Schema();
1941
+ init_list2();
1447
1942
  init_schema_utils();
1448
1943
  }
1449
1944
  });
@@ -1473,36 +1968,31 @@ var init_discriminant = __esm({
1473
1968
  function union(discriminant2, union2) {
1474
1969
  const rawDiscriminant = typeof discriminant2 === "string" ? discriminant2 : discriminant2.rawDiscriminant;
1475
1970
  const parsedDiscriminant = typeof discriminant2 === "string" ? discriminant2 : discriminant2.parsedDiscriminant;
1971
+ const discriminantValueSchema = enum_(keys(union2));
1476
1972
  const baseSchema = {
1477
- ...OBJECT_LIKE_BRAND,
1478
1973
  parse: async (raw, opts) => {
1479
- const { [rawDiscriminant]: discriminantValue, ...additionalProperties } = raw;
1480
- const additionalPropertySchemas = union2[discriminantValue];
1481
- if (additionalPropertySchemas == null) {
1482
- return {
1483
- ...additionalProperties,
1484
- [parsedDiscriminant]: discriminantValue
1485
- };
1486
- }
1487
- return {
1488
- ...await additionalPropertySchemas.parse(additionalProperties, opts),
1489
- [parsedDiscriminant]: discriminantValue
1490
- };
1974
+ return transformAndValidateUnion(
1975
+ raw,
1976
+ rawDiscriminant,
1977
+ parsedDiscriminant,
1978
+ (discriminantValue) => discriminantValueSchema.parse(discriminantValue, opts),
1979
+ (discriminantValue) => union2[discriminantValue],
1980
+ (opts == null ? void 0 : opts.allowUnknownKeys) ?? false,
1981
+ (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts)
1982
+ );
1491
1983
  },
1492
1984
  json: async (parsed, opts) => {
1493
- const { [parsedDiscriminant]: discriminantValue, ...additionalProperties } = parsed;
1494
- const additionalPropertySchemas = union2[discriminantValue];
1495
- if (additionalPropertySchemas == null) {
1496
- return {
1497
- ...additionalProperties,
1498
- [rawDiscriminant]: discriminantValue
1499
- };
1500
- }
1501
- return {
1502
- ...await additionalPropertySchemas.json(additionalProperties, opts),
1503
- [rawDiscriminant]: discriminantValue
1504
- };
1505
- }
1985
+ return transformAndValidateUnion(
1986
+ parsed,
1987
+ parsedDiscriminant,
1988
+ rawDiscriminant,
1989
+ (discriminantValue) => discriminantValueSchema.json(discriminantValue, opts),
1990
+ (discriminantValue) => union2[discriminantValue],
1991
+ (opts == null ? void 0 : opts.allowUnknownKeys) ?? false,
1992
+ (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts)
1993
+ );
1994
+ },
1995
+ getType: () => SchemaType.UNION
1506
1996
  };
1507
1997
  return {
1508
1998
  ...baseSchema,
@@ -1510,9 +2000,84 @@ function union(discriminant2, union2) {
1510
2000
  ...getObjectLikeUtils(baseSchema)
1511
2001
  };
1512
2002
  }
2003
+ async function transformAndValidateUnion(value, discriminant2, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnknownKeys, transformAdditionalProperties) {
2004
+ if (!isPlainObject(value)) {
2005
+ return {
2006
+ ok: false,
2007
+ errors: [
2008
+ {
2009
+ path: [],
2010
+ message: NOT_AN_OBJECT_ERROR_MESSAGE
2011
+ }
2012
+ ]
2013
+ };
2014
+ }
2015
+ const { [discriminant2]: discriminantValue, ...additionalProperties } = value;
2016
+ if (discriminantValue == null) {
2017
+ return {
2018
+ ok: false,
2019
+ errors: [
2020
+ {
2021
+ path: [],
2022
+ message: `Missing discriminant ("${discriminant2}")`
2023
+ }
2024
+ ]
2025
+ };
2026
+ }
2027
+ const transformedDiscriminantValue = await transformDiscriminantValue(discriminantValue);
2028
+ if (!transformedDiscriminantValue.ok) {
2029
+ return {
2030
+ ok: false,
2031
+ errors: transformedDiscriminantValue.errors.map((error) => ({
2032
+ path: [discriminant2, ...error.path],
2033
+ message: error.message
2034
+ }))
2035
+ };
2036
+ }
2037
+ const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
2038
+ if (additionalPropertiesSchema == null) {
2039
+ if (allowUnknownKeys) {
2040
+ return {
2041
+ ok: true,
2042
+ value: {
2043
+ [transformedDiscriminant]: transformedDiscriminantValue.value,
2044
+ ...additionalProperties
2045
+ }
2046
+ };
2047
+ } else {
2048
+ return {
2049
+ ok: false,
2050
+ errors: [
2051
+ {
2052
+ path: [discriminant2],
2053
+ message: "Unrecognized discriminant value"
2054
+ }
2055
+ ]
2056
+ };
2057
+ }
2058
+ }
2059
+ const transformedAdditionalProperties = await transformAdditionalProperties(
2060
+ additionalProperties,
2061
+ additionalPropertiesSchema
2062
+ );
2063
+ if (!transformedAdditionalProperties.ok) {
2064
+ return transformedAdditionalProperties;
2065
+ }
2066
+ return {
2067
+ ok: true,
2068
+ value: {
2069
+ [transformedDiscriminant]: discriminantValue,
2070
+ ...transformedAdditionalProperties.value
2071
+ }
2072
+ };
2073
+ }
1513
2074
  var init_union = __esm({
1514
2075
  "src/core/schemas/builders/union/union.ts"() {
1515
2076
  "use strict";
2077
+ init_Schema();
2078
+ init_isPlainObject();
2079
+ init_keys();
2080
+ init_enum2();
1516
2081
  init_object_like();
1517
2082
  init_schema_utils();
1518
2083
  }
@@ -1533,7 +2098,6 @@ var init_builders = __esm({
1533
2098
  "use strict";
1534
2099
  init_date2();
1535
2100
  init_enum2();
1536
- init_identity2();
1537
2101
  init_lazy2();
1538
2102
  init_list2();
1539
2103
  init_literals();
@@ -1550,18 +2114,16 @@ var init_builders = __esm({
1550
2114
  // src/core/schemas/index.ts
1551
2115
  var schemas_exports = {};
1552
2116
  __export(schemas_exports, {
1553
- OBJECT_LIKE_BRAND: () => OBJECT_LIKE_BRAND,
1554
- OPTIONAL_BRAND: () => OPTIONAL_BRAND,
2117
+ JsonError: () => JsonError,
2118
+ ParseError: () => ParseError,
1555
2119
  any: () => any,
1556
2120
  boolean: () => boolean,
1557
- createIdentitySchemaCreator: () => createIdentitySchemaCreator,
1558
2121
  date: () => date,
1559
2122
  discriminant: () => discriminant,
1560
2123
  enum_: () => enum_,
1561
2124
  getObjectLikeUtils: () => getObjectLikeUtils,
1562
2125
  getObjectUtils: () => getObjectUtils,
1563
2126
  getSchemaUtils: () => getSchemaUtils,
1564
- identity: () => identity,
1565
2127
  isProperty: () => isProperty,
1566
2128
  lazy: () => lazy,
1567
2129
  lazyObject: () => lazyObject,
@@ -1577,12 +2139,13 @@ __export(schemas_exports, {
1577
2139
  transform: () => transform,
1578
2140
  union: () => union,
1579
2141
  unknown: () => unknown,
1580
- withProperties: () => withProperties
2142
+ withParsedProperties: () => withParsedProperties
1581
2143
  });
1582
2144
  var init_schemas = __esm({
1583
2145
  "src/core/schemas/index.ts"() {
1584
2146
  "use strict";
1585
2147
  init_builders();
2148
+ init_Schema();
1586
2149
  }
1587
2150
  });
1588
2151
 
@@ -1792,7 +2355,7 @@ var require_utils = __commonJS({
1792
2355
  function isObject(val) {
1793
2356
  return val !== null && typeof val === "object";
1794
2357
  }
1795
- function isPlainObject(val) {
2358
+ function isPlainObject2(val) {
1796
2359
  if (kindOf(val) !== "object") {
1797
2360
  return false;
1798
2361
  }
@@ -1845,9 +2408,9 @@ var require_utils = __commonJS({
1845
2408
  function merge() {
1846
2409
  var result = {};
1847
2410
  function assignValue(val, key) {
1848
- if (isPlainObject(result[key]) && isPlainObject(val)) {
2411
+ if (isPlainObject2(result[key]) && isPlainObject2(val)) {
1849
2412
  result[key] = merge(result[key], val);
1850
- } else if (isPlainObject(val)) {
2413
+ } else if (isPlainObject2(val)) {
1851
2414
  result[key] = merge({}, val);
1852
2415
  } else if (isArray(val)) {
1853
2416
  result[key] = val.slice();
@@ -1936,7 +2499,7 @@ var require_utils = __commonJS({
1936
2499
  isString,
1937
2500
  isNumber,
1938
2501
  isObject,
1939
- isPlainObject,
2502
+ isPlainObject: isPlainObject2,
1940
2503
  isUndefined,
1941
2504
  isDate,
1942
2505
  isFile,
@@ -13473,7 +14036,7 @@ var init_Fetcher = __esm({
13473
14036
  transitional: {
13474
14037
  clarifyTimeoutError: true
13475
14038
  },
13476
- withCredentials: true
14039
+ withCredentials: args.withCredentials
13477
14040
  });
13478
14041
  let body;
13479
14042
  if (response.data != null && response.data.length > 0) {
@@ -13501,7 +14064,6 @@ var init_Fetcher = __esm({
13501
14064
  error: {
13502
14065
  reason: "status-code",
13503
14066
  statusCode: response.status,
13504
- rawBody: response.data,
13505
14067
  body
13506
14068
  }
13507
14069
  };
@@ -13649,10 +14211,7 @@ var init_Client = __esm({
13649
14211
  headers: {
13650
14212
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13651
14213
  },
13652
- body: await organization_exports2.create.Request.json({
13653
- organizationId: request.organizationId,
13654
- artifactReadRequiresToken: request.artifactReadRequiresToken
13655
- })
14214
+ body: await CreateOrganizationRequest.jsonOrThrow(request)
13656
14215
  });
13657
14216
  if (_response.ok) {
13658
14217
  return {
@@ -13666,8 +14225,9 @@ var init_Client = __esm({
13666
14225
  case "OrganizationAlreadyExistsError":
13667
14226
  return {
13668
14227
  ok: false,
13669
- error: await organization_exports2.create.Error.parse(
13670
- _response.error.body
14228
+ error: await organization_exports2.create.Error.parseOrThrow(
14229
+ _response.error.body,
14230
+ { allowUnknownKeys: true }
13671
14231
  )
13672
14232
  };
13673
14233
  }
@@ -13680,14 +14240,15 @@ var init_Client = __esm({
13680
14240
  async update(orgId, request) {
13681
14241
  var _a;
13682
14242
  const _response = await fetcher({
13683
- url: (0, import_url_join.default)(this.options.environment, `/organizations/${orgId}/update`),
14243
+ url: (0, import_url_join.default)(
14244
+ this.options.environment,
14245
+ `/organizations/${await OrganizationId2.jsonOrThrow(orgId)}/update`
14246
+ ),
13684
14247
  method: "POST",
13685
14248
  headers: {
13686
14249
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13687
14250
  },
13688
- body: await organization_exports2.update.Request.json({
13689
- artifactReadRequiresToken: request.artifactReadRequiresToken
13690
- })
14251
+ body: await UpdateOrganizationRequest.jsonOrThrow(request)
13691
14252
  });
13692
14253
  if (_response.ok) {
13693
14254
  return {
@@ -13700,8 +14261,9 @@ var init_Client = __esm({
13700
14261
  case "UnauthorizedError":
13701
14262
  return {
13702
14263
  ok: false,
13703
- error: await organization_exports2.update.Error.parse(
13704
- _response.error.body
14264
+ error: await organization_exports2.update.Error.parseOrThrow(
14265
+ _response.error.body,
14266
+ { allowUnknownKeys: true }
13705
14267
  )
13706
14268
  };
13707
14269
  }
@@ -13714,7 +14276,10 @@ var init_Client = __esm({
13714
14276
  async get(orgId) {
13715
14277
  var _a;
13716
14278
  const _response = await fetcher({
13717
- url: (0, import_url_join.default)(this.options.environment, `/organizations/${orgId}`),
14279
+ url: (0, import_url_join.default)(
14280
+ this.options.environment,
14281
+ `/organizations/${await OrganizationId2.jsonOrThrow(orgId)}`
14282
+ ),
13718
14283
  method: "GET",
13719
14284
  headers: {
13720
14285
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
@@ -13723,9 +14288,9 @@ var init_Client = __esm({
13723
14288
  if (_response.ok) {
13724
14289
  return {
13725
14290
  ok: true,
13726
- body: await organization_exports2.get.Response.parse(
13727
- _response.body
13728
- )
14291
+ body: await Organization.parseOrThrow(_response.body, {
14292
+ allowUnknownKeys: true
14293
+ })
13729
14294
  };
13730
14295
  }
13731
14296
  if (_response.error.reason === "status-code") {
@@ -13733,8 +14298,9 @@ var init_Client = __esm({
13733
14298
  case "UnauthorizedError":
13734
14299
  return {
13735
14300
  ok: false,
13736
- error: await organization_exports2.get.Error.parse(
13737
- _response.error.body
14301
+ error: await organization_exports2.get.Error.parseOrThrow(
14302
+ _response.error.body,
14303
+ { allowUnknownKeys: true }
13738
14304
  )
13739
14305
  };
13740
14306
  }
@@ -13746,7 +14312,10 @@ var init_Client = __esm({
13746
14312
  }
13747
14313
  async isMember(organizationId) {
13748
14314
  const _response = await fetcher({
13749
- url: (0, import_url_join.default)(this.options.environment, `/organizations/belongs-to-organization/${organizationId}`),
14315
+ url: (0, import_url_join.default)(
14316
+ this.options.environment,
14317
+ `/organizations/belongs-to-organization/${await OrganizationId2.jsonOrThrow(organizationId)}`
14318
+ ),
13750
14319
  method: "POST",
13751
14320
  headers: {
13752
14321
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
@@ -13755,8 +14324,9 @@ var init_Client = __esm({
13755
14324
  if (_response.ok) {
13756
14325
  return {
13757
14326
  ok: true,
13758
- body: await organization_exports2.isMember.Response.parse(
13759
- _response.body
14327
+ body: await organization_exports2.isMember.Response.parseOrThrow(
14328
+ _response.body,
14329
+ { allowUnknownKeys: true }
13760
14330
  )
13761
14331
  };
13762
14332
  }
@@ -13780,9 +14350,9 @@ var init_Client = __esm({
13780
14350
  if (_response.ok) {
13781
14351
  return {
13782
14352
  ok: true,
13783
- body: await organization_exports2.getMyOrganizationFromScopedToken.Response.parse(
13784
- _response.body
13785
- )
14353
+ body: await Organization.parseOrThrow(_response.body, {
14354
+ allowUnknownKeys: true
14355
+ })
13786
14356
  };
13787
14357
  }
13788
14358
  if (_response.error.reason === "status-code") {
@@ -13790,8 +14360,9 @@ var init_Client = __esm({
13790
14360
  case "UnauthorizedError":
13791
14361
  return {
13792
14362
  ok: false,
13793
- error: await organization_exports2.getMyOrganizationFromScopedToken.Error.parse(
13794
- _response.error.body
14363
+ error: await organization_exports2.getMyOrganizationFromScopedToken.Error.parseOrThrow(
14364
+ _response.error.body,
14365
+ { allowUnknownKeys: true }
13795
14366
  )
13796
14367
  };
13797
14368
  }
@@ -13809,10 +14380,7 @@ var init_Client = __esm({
13809
14380
  headers: {
13810
14381
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13811
14382
  },
13812
- body: await organization_exports2.addUser.Request.json({
13813
- userId: request.userId,
13814
- orgId: request.orgId
13815
- })
14383
+ body: await AddUserToOrgRequest.jsonOrThrow(request)
13816
14384
  });
13817
14385
  if (_response.ok) {
13818
14386
  return {
@@ -13826,8 +14394,9 @@ var init_Client = __esm({
13826
14394
  case "UserIdDoesNotExistError":
13827
14395
  return {
13828
14396
  ok: false,
13829
- error: await organization_exports2.addUser.Error.parse(
13830
- _response.error.body
14397
+ error: await organization_exports2.addUser.Error.parseOrThrow(
14398
+ _response.error.body,
14399
+ { allowUnknownKeys: true }
13831
14400
  )
13832
14401
  };
13833
14402
  }
@@ -13862,16 +14431,14 @@ var init_Client2 = __esm({
13862
14431
  headers: {
13863
14432
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13864
14433
  },
13865
- body: await registry_exports2.generateRegistryTokens.Request.json({
13866
- organizationId: request.organizationId
13867
- })
14434
+ body: await GenerateRegistryTokensRequest.jsonOrThrow(request)
13868
14435
  });
13869
14436
  if (_response.ok) {
13870
14437
  return {
13871
14438
  ok: true,
13872
- body: await registry_exports2.generateRegistryTokens.Response.parse(
13873
- _response.body
13874
- )
14439
+ body: await RegistryTokens.parseOrThrow(_response.body, {
14440
+ allowUnknownKeys: true
14441
+ })
13875
14442
  };
13876
14443
  }
13877
14444
  if (_response.error.reason === "status-code") {
@@ -13880,8 +14447,9 @@ var init_Client2 = __esm({
13880
14447
  case "OrganizationNotFoundError":
13881
14448
  return {
13882
14449
  ok: false,
13883
- error: await registry_exports2.generateRegistryTokens.Error.parse(
13884
- _response.error.body
14450
+ error: await registry_exports2.generateRegistryTokens.Error.parseOrThrow(
14451
+ _response.error.body,
14452
+ { allowUnknownKeys: true }
13885
14453
  )
13886
14454
  };
13887
14455
  }
@@ -13899,16 +14467,14 @@ var init_Client2 = __esm({
13899
14467
  headers: {
13900
14468
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13901
14469
  },
13902
- body: await registry_exports2.hasRegistryPermission.Request.json({
13903
- organizationId: request.organizationId,
13904
- token: request.token
13905
- })
14470
+ body: await CheckRegistryPermissionRequest.jsonOrThrow(request)
13906
14471
  });
13907
14472
  if (_response.ok) {
13908
14473
  return {
13909
14474
  ok: true,
13910
- body: await registry_exports2.hasRegistryPermission.Response.parse(
13911
- _response.body
14475
+ body: await registry_exports2.hasRegistryPermission.Response.parseOrThrow(
14476
+ _response.body,
14477
+ { allowUnknownKeys: true }
13912
14478
  )
13913
14479
  };
13914
14480
  }
@@ -13918,8 +14484,9 @@ var init_Client2 = __esm({
13918
14484
  case "OrganizationNotFoundError":
13919
14485
  return {
13920
14486
  ok: false,
13921
- error: await registry_exports2.hasRegistryPermission.Error.parse(
13922
- _response.error.body
14487
+ error: await registry_exports2.hasRegistryPermission.Error.parseOrThrow(
14488
+ _response.error.body,
14489
+ { allowUnknownKeys: true }
13923
14490
  )
13924
14491
  };
13925
14492
  }
@@ -13937,10 +14504,7 @@ var init_Client2 = __esm({
13937
14504
  headers: {
13938
14505
  Authorization: BearerToken.toAuthorizationHeader(await Supplier.get(this.options.token))
13939
14506
  },
13940
- body: await registry_exports2.revokeToken.Request.json({
13941
- organizationId: request.organizationId,
13942
- token: request.token
13943
- })
14507
+ body: await RevokeTokenRequest.jsonOrThrow(request)
13944
14508
  });
13945
14509
  if (_response.ok) {
13946
14510
  return {
@@ -13954,8 +14518,9 @@ var init_Client2 = __esm({
13954
14518
  case "OrganizationNotFoundError":
13955
14519
  return {
13956
14520
  ok: false,
13957
- error: await registry_exports2.revokeToken.Error.parse(
13958
- _response.error.body
14521
+ error: await registry_exports2.revokeToken.Error.parseOrThrow(
14522
+ _response.error.body,
14523
+ { allowUnknownKeys: true }
13959
14524
  )
13960
14525
  };
13961
14526
  }
@@ -13993,9 +14558,9 @@ var init_Client3 = __esm({
13993
14558
  if (_response.ok) {
13994
14559
  return {
13995
14560
  ok: true,
13996
- body: await user_exports2.getMyself.Response.parse(
13997
- _response.body
13998
- )
14561
+ body: await User.parseOrThrow(_response.body, {
14562
+ allowUnknownKeys: true
14563
+ })
13999
14564
  };
14000
14565
  }
14001
14566
  return {
@@ -14004,8 +14569,9 @@ var init_Client3 = __esm({
14004
14569
  };
14005
14570
  }
14006
14571
  async getMyOrganizations(request) {
14572
+ const { pageId } = request;
14007
14573
  const _queryParams = new URLSearchParams();
14008
- _queryParams.append("pageId", request.pageId.toString());
14574
+ _queryParams.append("pageId", pageId.toString());
14009
14575
  const _response = await fetcher({
14010
14576
  url: (0, import_url_join3.default)(this.options.environment, "/users/organizations"),
14011
14577
  method: "GET",
@@ -14017,8 +14583,9 @@ var init_Client3 = __esm({
14017
14583
  if (_response.ok) {
14018
14584
  return {
14019
14585
  ok: true,
14020
- body: await user_exports2.getMyOrganizations.Response.parse(
14021
- _response.body
14586
+ body: await OrganizationsPage.parseOrThrow(
14587
+ _response.body,
14588
+ { allowUnknownKeys: true }
14022
14589
  )
14023
14590
  };
14024
14591
  }
@@ -14079,8 +14646,8 @@ var init_OrganizationId2 = __esm({
14079
14646
  init_src();
14080
14647
  init_core();
14081
14648
  OrganizationId2 = schemas_exports.string().transform({
14082
- parse: api_exports.OrganizationId,
14083
- json: (value) => value
14649
+ transform: api_exports.OrganizationId,
14650
+ untransform: (value) => value
14084
14651
  });
14085
14652
  }
14086
14653
  });
@@ -14093,14 +14660,14 @@ var init_UserId2 = __esm({
14093
14660
  init_src();
14094
14661
  init_core();
14095
14662
  UserId2 = schemas_exports.string().transform({
14096
- parse: api_exports.UserId,
14097
- json: (value) => value
14663
+ transform: api_exports.UserId,
14664
+ untransform: (value) => value
14098
14665
  });
14099
14666
  }
14100
14667
  });
14101
14668
 
14102
14669
  // src/serialization/resources/commons/types/index.ts
14103
- var init_types7 = __esm({
14670
+ var init_types5 = __esm({
14104
14671
  "src/serialization/resources/commons/types/index.ts"() {
14105
14672
  "use strict";
14106
14673
  init_OrganizationId2();
@@ -14117,7 +14684,7 @@ __export(commons_exports2, {
14117
14684
  var init_commons2 = __esm({
14118
14685
  "src/serialization/resources/commons/index.ts"() {
14119
14686
  "use strict";
14120
- init_types7();
14687
+ init_types5();
14121
14688
  }
14122
14689
  });
14123
14690
 
@@ -14135,7 +14702,7 @@ var init_Organization2 = __esm({
14135
14702
  });
14136
14703
 
14137
14704
  // src/serialization/resources/organization/types/index.ts
14138
- var init_types8 = __esm({
14705
+ var init_types6 = __esm({
14139
14706
  "src/serialization/resources/organization/types/index.ts"() {
14140
14707
  "use strict";
14141
14708
  init_Organization2();
@@ -14145,24 +14712,19 @@ var init_types8 = __esm({
14145
14712
  // src/serialization/resources/organization/client/create.ts
14146
14713
  var create_exports2 = {};
14147
14714
  __export(create_exports2, {
14148
- Error: () => Error13,
14149
- Request: () => Request
14715
+ Error: () => Error13
14150
14716
  });
14151
- var Request, Error13;
14717
+ var Error13;
14152
14718
  var init_create2 = __esm({
14153
14719
  "src/serialization/resources/organization/client/create.ts"() {
14154
14720
  "use strict";
14155
14721
  init_src();
14156
14722
  init_core();
14157
- Request = schemas_exports.object({
14158
- organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
14159
- artifactReadRequiresToken: schemas_exports.boolean().optional()
14160
- });
14161
14723
  Error13 = schemas_exports.union("error", {
14162
14724
  UnauthorizedError: schemas_exports.object({}),
14163
14725
  OrganizationAlreadyExistsError: schemas_exports.object({})
14164
14726
  }).transform({
14165
- parse: (value) => {
14727
+ transform: (value) => {
14166
14728
  switch (value.error) {
14167
14729
  case "UnauthorizedError":
14168
14730
  return api_exports.organization.create.Error.unauthorizedError();
@@ -14170,7 +14732,7 @@ var init_create2 = __esm({
14170
14732
  return api_exports.organization.create.Error.organizationAlreadyExistsError();
14171
14733
  }
14172
14734
  },
14173
- json: (value) => value
14735
+ untransform: ({ _visit, ...value }) => value
14174
14736
  });
14175
14737
  }
14176
14738
  });
@@ -14178,28 +14740,24 @@ var init_create2 = __esm({
14178
14740
  // src/serialization/resources/organization/client/update.ts
14179
14741
  var update_exports2 = {};
14180
14742
  __export(update_exports2, {
14181
- Error: () => Error14,
14182
- Request: () => Request2
14743
+ Error: () => Error14
14183
14744
  });
14184
- var Request2, Error14;
14745
+ var Error14;
14185
14746
  var init_update2 = __esm({
14186
14747
  "src/serialization/resources/organization/client/update.ts"() {
14187
14748
  "use strict";
14188
14749
  init_src();
14189
14750
  init_core();
14190
- Request2 = schemas_exports.object({
14191
- artifactReadRequiresToken: schemas_exports.boolean()
14192
- });
14193
14751
  Error14 = schemas_exports.union("error", {
14194
14752
  UnauthorizedError: schemas_exports.object({})
14195
14753
  }).transform({
14196
- parse: (value) => {
14754
+ transform: (value) => {
14197
14755
  switch (value.error) {
14198
14756
  case "UnauthorizedError":
14199
14757
  return api_exports.organization.update.Error.unauthorizedError();
14200
14758
  }
14201
14759
  },
14202
- json: (value) => value
14760
+ untransform: ({ _visit, ...value }) => value
14203
14761
  });
14204
14762
  }
14205
14763
  });
@@ -14207,26 +14765,24 @@ var init_update2 = __esm({
14207
14765
  // src/serialization/resources/organization/client/get.ts
14208
14766
  var get_exports2 = {};
14209
14767
  __export(get_exports2, {
14210
- Error: () => Error15,
14211
- Response: () => Response
14768
+ Error: () => Error15
14212
14769
  });
14213
- var Response, Error15;
14770
+ var Error15;
14214
14771
  var init_get2 = __esm({
14215
14772
  "src/serialization/resources/organization/client/get.ts"() {
14216
14773
  "use strict";
14217
14774
  init_src();
14218
14775
  init_core();
14219
- Response = schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).Organization);
14220
14776
  Error15 = schemas_exports.union("error", {
14221
14777
  UnauthorizedError: schemas_exports.object({})
14222
14778
  }).transform({
14223
- parse: (value) => {
14779
+ transform: (value) => {
14224
14780
  switch (value.error) {
14225
14781
  case "UnauthorizedError":
14226
14782
  return api_exports.organization.get.Error.unauthorizedError();
14227
14783
  }
14228
14784
  },
14229
- json: (value) => value
14785
+ untransform: ({ _visit, ...value }) => value
14230
14786
  });
14231
14787
  }
14232
14788
  });
@@ -14234,40 +14790,38 @@ var init_get2 = __esm({
14234
14790
  // src/serialization/resources/organization/client/isMember.ts
14235
14791
  var isMember_exports2 = {};
14236
14792
  __export(isMember_exports2, {
14237
- Response: () => Response2
14793
+ Response: () => Response
14238
14794
  });
14239
- var Response2;
14795
+ var Response;
14240
14796
  var init_isMember2 = __esm({
14241
14797
  "src/serialization/resources/organization/client/isMember.ts"() {
14242
14798
  "use strict";
14243
14799
  init_core();
14244
- Response2 = schemas_exports.boolean();
14800
+ Response = schemas_exports.boolean();
14245
14801
  }
14246
14802
  });
14247
14803
 
14248
14804
  // src/serialization/resources/organization/client/getMyOrganizationFromScopedToken.ts
14249
14805
  var getMyOrganizationFromScopedToken_exports2 = {};
14250
14806
  __export(getMyOrganizationFromScopedToken_exports2, {
14251
- Error: () => Error16,
14252
- Response: () => Response3
14807
+ Error: () => Error16
14253
14808
  });
14254
- var Response3, Error16;
14809
+ var Error16;
14255
14810
  var init_getMyOrganizationFromScopedToken2 = __esm({
14256
14811
  "src/serialization/resources/organization/client/getMyOrganizationFromScopedToken.ts"() {
14257
14812
  "use strict";
14258
14813
  init_src();
14259
14814
  init_core();
14260
- Response3 = schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).Organization);
14261
14815
  Error16 = schemas_exports.union("error", {
14262
14816
  UnauthorizedError: schemas_exports.object({})
14263
14817
  }).transform({
14264
- parse: (value) => {
14818
+ transform: (value) => {
14265
14819
  switch (value.error) {
14266
14820
  case "UnauthorizedError":
14267
14821
  return api_exports.organization.getMyOrganizationFromScopedToken.Error.unauthorizedError();
14268
14822
  }
14269
14823
  },
14270
- json: (value) => value
14824
+ untransform: ({ _visit, ...value }) => value
14271
14825
  });
14272
14826
  }
14273
14827
  });
@@ -14275,24 +14829,19 @@ var init_getMyOrganizationFromScopedToken2 = __esm({
14275
14829
  // src/serialization/resources/organization/client/addUser.ts
14276
14830
  var addUser_exports2 = {};
14277
14831
  __export(addUser_exports2, {
14278
- Error: () => Error17,
14279
- Request: () => Request3
14832
+ Error: () => Error17
14280
14833
  });
14281
- var Request3, Error17;
14834
+ var Error17;
14282
14835
  var init_addUser2 = __esm({
14283
14836
  "src/serialization/resources/organization/client/addUser.ts"() {
14284
14837
  "use strict";
14285
14838
  init_src();
14286
14839
  init_core();
14287
- Request3 = schemas_exports.object({
14288
- userId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).UserId),
14289
- orgId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId)
14290
- });
14291
14840
  Error17 = schemas_exports.union("error", {
14292
14841
  UnauthorizedError: schemas_exports.object({}),
14293
14842
  UserIdDoesNotExistError: schemas_exports.object({})
14294
14843
  }).transform({
14295
- parse: (value) => {
14844
+ transform: (value) => {
14296
14845
  switch (value.error) {
14297
14846
  case "UnauthorizedError":
14298
14847
  return api_exports.organization.addUser.Error.unauthorizedError();
@@ -14300,11 +14849,59 @@ var init_addUser2 = __esm({
14300
14849
  return api_exports.organization.addUser.Error.userIdDoesNotExistError();
14301
14850
  }
14302
14851
  },
14303
- json: (value) => value
14852
+ untransform: ({ _visit, ...value }) => value
14853
+ });
14854
+ }
14855
+ });
14856
+
14857
+ // src/serialization/resources/organization/client/requests/CreateOrganizationRequest.ts
14858
+ var CreateOrganizationRequest;
14859
+ var init_CreateOrganizationRequest = __esm({
14860
+ "src/serialization/resources/organization/client/requests/CreateOrganizationRequest.ts"() {
14861
+ "use strict";
14862
+ init_core();
14863
+ CreateOrganizationRequest = schemas_exports.object({
14864
+ organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
14865
+ artifactReadRequiresToken: schemas_exports.boolean().optional()
14866
+ });
14867
+ }
14868
+ });
14869
+
14870
+ // src/serialization/resources/organization/client/requests/UpdateOrganizationRequest.ts
14871
+ var UpdateOrganizationRequest;
14872
+ var init_UpdateOrganizationRequest = __esm({
14873
+ "src/serialization/resources/organization/client/requests/UpdateOrganizationRequest.ts"() {
14874
+ "use strict";
14875
+ init_core();
14876
+ UpdateOrganizationRequest = schemas_exports.object({
14877
+ artifactReadRequiresToken: schemas_exports.boolean()
14878
+ });
14879
+ }
14880
+ });
14881
+
14882
+ // src/serialization/resources/organization/client/requests/AddUserToOrgRequest.ts
14883
+ var AddUserToOrgRequest;
14884
+ var init_AddUserToOrgRequest = __esm({
14885
+ "src/serialization/resources/organization/client/requests/AddUserToOrgRequest.ts"() {
14886
+ "use strict";
14887
+ init_core();
14888
+ AddUserToOrgRequest = schemas_exports.object({
14889
+ userId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).UserId),
14890
+ orgId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId)
14304
14891
  });
14305
14892
  }
14306
14893
  });
14307
14894
 
14895
+ // src/serialization/resources/organization/client/requests/index.ts
14896
+ var init_requests4 = __esm({
14897
+ "src/serialization/resources/organization/client/requests/index.ts"() {
14898
+ "use strict";
14899
+ init_CreateOrganizationRequest();
14900
+ init_UpdateOrganizationRequest();
14901
+ init_AddUserToOrgRequest();
14902
+ }
14903
+ });
14904
+
14308
14905
  // src/serialization/resources/organization/client/index.ts
14309
14906
  var init_client4 = __esm({
14310
14907
  "src/serialization/resources/organization/client/index.ts"() {
@@ -14315,13 +14912,17 @@ var init_client4 = __esm({
14315
14912
  init_isMember2();
14316
14913
  init_getMyOrganizationFromScopedToken2();
14317
14914
  init_addUser2();
14915
+ init_requests4();
14318
14916
  }
14319
14917
  });
14320
14918
 
14321
14919
  // src/serialization/resources/organization/index.ts
14322
14920
  var organization_exports2 = {};
14323
14921
  __export(organization_exports2, {
14922
+ AddUserToOrgRequest: () => AddUserToOrgRequest,
14923
+ CreateOrganizationRequest: () => CreateOrganizationRequest,
14324
14924
  Organization: () => Organization,
14925
+ UpdateOrganizationRequest: () => UpdateOrganizationRequest,
14325
14926
  addUser: () => addUser_exports2,
14326
14927
  create: () => create_exports2,
14327
14928
  get: () => get_exports2,
@@ -14332,7 +14933,7 @@ __export(organization_exports2, {
14332
14933
  var init_organization2 = __esm({
14333
14934
  "src/serialization/resources/organization/index.ts"() {
14334
14935
  "use strict";
14335
- init_types8();
14936
+ init_types6();
14336
14937
  init_client4();
14337
14938
  }
14338
14939
  });
@@ -14386,7 +14987,7 @@ var init_RegistryToken2 = __esm({
14386
14987
  npm: schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).NpmRegistryToken),
14387
14988
  maven: schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).MavenRegistryToken)
14388
14989
  }).transform({
14389
- parse: (value) => {
14990
+ transform: (value) => {
14390
14991
  switch (value.type) {
14391
14992
  case "npm":
14392
14993
  return api_exports.RegistryToken.npm(value);
@@ -14396,13 +14997,13 @@ var init_RegistryToken2 = __esm({
14396
14997
  return api_exports.RegistryToken._unknown(value);
14397
14998
  }
14398
14999
  },
14399
- json: (value) => value
15000
+ untransform: ({ _visit, ...value }) => value
14400
15001
  });
14401
15002
  }
14402
15003
  });
14403
15004
 
14404
15005
  // src/serialization/resources/registry/types/index.ts
14405
- var init_types9 = __esm({
15006
+ var init_types7 = __esm({
14406
15007
  "src/serialization/resources/registry/types/index.ts"() {
14407
15008
  "use strict";
14408
15009
  init_RegistryTokens2();
@@ -14415,25 +15016,19 @@ var init_types9 = __esm({
14415
15016
  // src/serialization/resources/registry/client/generateRegistryTokens.ts
14416
15017
  var generateRegistryTokens_exports2 = {};
14417
15018
  __export(generateRegistryTokens_exports2, {
14418
- Error: () => Error18,
14419
- Request: () => Request4,
14420
- Response: () => Response4
15019
+ Error: () => Error18
14421
15020
  });
14422
- var Request4, Response4, Error18;
15021
+ var Error18;
14423
15022
  var init_generateRegistryTokens2 = __esm({
14424
15023
  "src/serialization/resources/registry/client/generateRegistryTokens.ts"() {
14425
15024
  "use strict";
14426
15025
  init_src();
14427
15026
  init_core();
14428
- Request4 = schemas_exports.object({
14429
- organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId)
14430
- });
14431
- Response4 = schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).RegistryTokens);
14432
15027
  Error18 = schemas_exports.union("error", {
14433
15028
  UnauthorizedError: schemas_exports.object({}),
14434
15029
  OrganizationNotFoundError: schemas_exports.object({})
14435
15030
  }).transform({
14436
- parse: (value) => {
15031
+ transform: (value) => {
14437
15032
  switch (value.error) {
14438
15033
  case "UnauthorizedError":
14439
15034
  return api_exports.registry.generateRegistryTokens.Error.unauthorizedError();
@@ -14441,7 +15036,7 @@ var init_generateRegistryTokens2 = __esm({
14441
15036
  return api_exports.registry.generateRegistryTokens.Error.organizationNotFoundError();
14442
15037
  }
14443
15038
  },
14444
- json: (value) => value
15039
+ untransform: ({ _visit, ...value }) => value
14445
15040
  });
14446
15041
  }
14447
15042
  });
@@ -14450,25 +15045,20 @@ var init_generateRegistryTokens2 = __esm({
14450
15045
  var hasRegistryPermission_exports2 = {};
14451
15046
  __export(hasRegistryPermission_exports2, {
14452
15047
  Error: () => Error19,
14453
- Request: () => Request5,
14454
- Response: () => Response5
15048
+ Response: () => Response2
14455
15049
  });
14456
- var Request5, Response5, Error19;
15050
+ var Response2, Error19;
14457
15051
  var init_hasRegistryPermission2 = __esm({
14458
15052
  "src/serialization/resources/registry/client/hasRegistryPermission.ts"() {
14459
15053
  "use strict";
14460
- init_src();
14461
15054
  init_core();
14462
- Request5 = schemas_exports.object({
14463
- organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
14464
- token: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).RegistryToken).optional()
14465
- });
14466
- Response5 = schemas_exports.boolean();
15055
+ init_src();
15056
+ Response2 = schemas_exports.boolean();
14467
15057
  Error19 = schemas_exports.union("error", {
14468
15058
  UnauthorizedError: schemas_exports.object({}),
14469
15059
  OrganizationNotFoundError: schemas_exports.object({})
14470
15060
  }).transform({
14471
- parse: (value) => {
15061
+ transform: (value) => {
14472
15062
  switch (value.error) {
14473
15063
  case "UnauthorizedError":
14474
15064
  return api_exports.registry.hasRegistryPermission.Error.unauthorizedError();
@@ -14476,7 +15066,7 @@ var init_hasRegistryPermission2 = __esm({
14476
15066
  return api_exports.registry.hasRegistryPermission.Error.organizationNotFoundError();
14477
15067
  }
14478
15068
  },
14479
- json: (value) => value
15069
+ untransform: ({ _visit, ...value }) => value
14480
15070
  });
14481
15071
  }
14482
15072
  });
@@ -14484,24 +15074,19 @@ var init_hasRegistryPermission2 = __esm({
14484
15074
  // src/serialization/resources/registry/client/revokeToken.ts
14485
15075
  var revokeToken_exports2 = {};
14486
15076
  __export(revokeToken_exports2, {
14487
- Error: () => Error20,
14488
- Request: () => Request6
15077
+ Error: () => Error20
14489
15078
  });
14490
- var Request6, Error20;
15079
+ var Error20;
14491
15080
  var init_revokeToken2 = __esm({
14492
15081
  "src/serialization/resources/registry/client/revokeToken.ts"() {
14493
15082
  "use strict";
14494
15083
  init_src();
14495
15084
  init_core();
14496
- Request6 = schemas_exports.object({
14497
- organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
14498
- token: schemas_exports.string()
14499
- });
14500
15085
  Error20 = schemas_exports.union("error", {
14501
15086
  UnauthorizedError: schemas_exports.object({}),
14502
15087
  OrganizationNotFoundError: schemas_exports.object({})
14503
15088
  }).transform({
14504
- parse: (value) => {
15089
+ transform: (value) => {
14505
15090
  switch (value.error) {
14506
15091
  case "UnauthorizedError":
14507
15092
  return api_exports.registry.revokeToken.Error.unauthorizedError();
@@ -14509,11 +15094,59 @@ var init_revokeToken2 = __esm({
14509
15094
  return api_exports.registry.revokeToken.Error.organizationNotFoundError();
14510
15095
  }
14511
15096
  },
14512
- json: (value) => value
15097
+ untransform: ({ _visit, ...value }) => value
14513
15098
  });
14514
15099
  }
14515
15100
  });
14516
15101
 
15102
+ // src/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.ts
15103
+ var GenerateRegistryTokensRequest;
15104
+ var init_GenerateRegistryTokensRequest = __esm({
15105
+ "src/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.ts"() {
15106
+ "use strict";
15107
+ init_core();
15108
+ GenerateRegistryTokensRequest = schemas_exports.object({
15109
+ organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId)
15110
+ });
15111
+ }
15112
+ });
15113
+
15114
+ // src/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.ts
15115
+ var CheckRegistryPermissionRequest;
15116
+ var init_CheckRegistryPermissionRequest = __esm({
15117
+ "src/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.ts"() {
15118
+ "use strict";
15119
+ init_core();
15120
+ CheckRegistryPermissionRequest = schemas_exports.object({
15121
+ organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
15122
+ token: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).RegistryToken).optional()
15123
+ });
15124
+ }
15125
+ });
15126
+
15127
+ // src/serialization/resources/registry/client/requests/RevokeTokenRequest.ts
15128
+ var RevokeTokenRequest;
15129
+ var init_RevokeTokenRequest = __esm({
15130
+ "src/serialization/resources/registry/client/requests/RevokeTokenRequest.ts"() {
15131
+ "use strict";
15132
+ init_core();
15133
+ RevokeTokenRequest = schemas_exports.object({
15134
+ organizationId: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationId),
15135
+ token: schemas_exports.string()
15136
+ });
15137
+ }
15138
+ });
15139
+
15140
+ // src/serialization/resources/registry/client/requests/index.ts
15141
+ var init_requests5 = __esm({
15142
+ "src/serialization/resources/registry/client/requests/index.ts"() {
15143
+ "use strict";
15144
+ init_GenerateRegistryTokensRequest();
15145
+ init_CheckRegistryPermissionRequest();
15146
+ init_RevokeTokenRequest();
15147
+ }
15148
+ });
15149
+
14517
15150
  // src/serialization/resources/registry/client/index.ts
14518
15151
  var init_client5 = __esm({
14519
15152
  "src/serialization/resources/registry/client/index.ts"() {
@@ -14521,16 +15154,20 @@ var init_client5 = __esm({
14521
15154
  init_generateRegistryTokens2();
14522
15155
  init_hasRegistryPermission2();
14523
15156
  init_revokeToken2();
15157
+ init_requests5();
14524
15158
  }
14525
15159
  });
14526
15160
 
14527
15161
  // src/serialization/resources/registry/index.ts
14528
15162
  var registry_exports2 = {};
14529
15163
  __export(registry_exports2, {
15164
+ CheckRegistryPermissionRequest: () => CheckRegistryPermissionRequest,
15165
+ GenerateRegistryTokensRequest: () => GenerateRegistryTokensRequest,
14530
15166
  MavenRegistryToken: () => MavenRegistryToken,
14531
15167
  NpmRegistryToken: () => NpmRegistryToken,
14532
15168
  RegistryToken: () => RegistryToken2,
14533
15169
  RegistryTokens: () => RegistryTokens,
15170
+ RevokeTokenRequest: () => RevokeTokenRequest,
14534
15171
  generateRegistryTokens: () => generateRegistryTokens_exports2,
14535
15172
  hasRegistryPermission: () => hasRegistryPermission_exports2,
14536
15173
  revokeToken: () => revokeToken_exports2
@@ -14538,7 +15175,7 @@ __export(registry_exports2, {
14538
15175
  var init_registry2 = __esm({
14539
15176
  "src/serialization/resources/registry/index.ts"() {
14540
15177
  "use strict";
14541
- init_types9();
15178
+ init_types7();
14542
15179
  init_client5();
14543
15180
  }
14544
15181
  });
@@ -14576,7 +15213,7 @@ var init_OrganizationsPage2 = __esm({
14576
15213
  });
14577
15214
 
14578
15215
  // src/serialization/resources/user/types/index.ts
14579
- var init_types10 = __esm({
15216
+ var init_types8 = __esm({
14580
15217
  "src/serialization/resources/user/types/index.ts"() {
14581
15218
  "use strict";
14582
15219
  init_User2();
@@ -14584,56 +15221,16 @@ var init_types10 = __esm({
14584
15221
  }
14585
15222
  });
14586
15223
 
14587
- // src/serialization/resources/user/client/getMyself.ts
14588
- var getMyself_exports2 = {};
14589
- __export(getMyself_exports2, {
14590
- Response: () => Response6
14591
- });
14592
- var Response6;
14593
- var init_getMyself2 = __esm({
14594
- "src/serialization/resources/user/client/getMyself.ts"() {
14595
- "use strict";
14596
- init_core();
14597
- Response6 = schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).User);
14598
- }
14599
- });
14600
-
14601
- // src/serialization/resources/user/client/getMyOrganizations.ts
14602
- var getMyOrganizations_exports2 = {};
14603
- __export(getMyOrganizations_exports2, {
14604
- Response: () => Response7
14605
- });
14606
- var Response7;
14607
- var init_getMyOrganizations2 = __esm({
14608
- "src/serialization/resources/user/client/getMyOrganizations.ts"() {
14609
- "use strict";
14610
- init_core();
14611
- Response7 = schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).OrganizationsPage);
14612
- }
14613
- });
14614
-
14615
- // src/serialization/resources/user/client/index.ts
14616
- var init_client6 = __esm({
14617
- "src/serialization/resources/user/client/index.ts"() {
14618
- "use strict";
14619
- init_getMyself2();
14620
- init_getMyOrganizations2();
14621
- }
14622
- });
14623
-
14624
15224
  // src/serialization/resources/user/index.ts
14625
15225
  var user_exports2 = {};
14626
15226
  __export(user_exports2, {
14627
15227
  OrganizationsPage: () => OrganizationsPage,
14628
- User: () => User,
14629
- getMyOrganizations: () => getMyOrganizations_exports2,
14630
- getMyself: () => getMyself_exports2
15228
+ User: () => User
14631
15229
  });
14632
15230
  var init_user2 = __esm({
14633
15231
  "src/serialization/resources/user/index.ts"() {
14634
15232
  "use strict";
14635
- init_types10();
14636
- init_client6();
15233
+ init_types8();
14637
15234
  }
14638
15235
  });
14639
15236
 
@@ -14642,19 +15239,25 @@ var init_resources2 = __esm({
14642
15239
  "src/serialization/resources/index.ts"() {
14643
15240
  "use strict";
14644
15241
  init_commons2();
14645
- init_types7();
15242
+ init_types5();
14646
15243
  init_organization2();
14647
- init_types8();
15244
+ init_types6();
14648
15245
  init_registry2();
14649
- init_types9();
15246
+ init_types7();
14650
15247
  init_user2();
14651
- init_types10();
15248
+ init_types8();
15249
+ init_requests4();
15250
+ init_requests5();
14652
15251
  }
14653
15252
  });
14654
15253
 
14655
15254
  // src/serialization/index.ts
14656
15255
  var serialization_exports = {};
14657
15256
  __export(serialization_exports, {
15257
+ AddUserToOrgRequest: () => AddUserToOrgRequest,
15258
+ CheckRegistryPermissionRequest: () => CheckRegistryPermissionRequest,
15259
+ CreateOrganizationRequest: () => CreateOrganizationRequest,
15260
+ GenerateRegistryTokensRequest: () => GenerateRegistryTokensRequest,
14658
15261
  MavenRegistryToken: () => MavenRegistryToken,
14659
15262
  NpmRegistryToken: () => NpmRegistryToken,
14660
15263
  Organization: () => Organization,
@@ -14662,6 +15265,8 @@ __export(serialization_exports, {
14662
15265
  OrganizationsPage: () => OrganizationsPage,
14663
15266
  RegistryToken: () => RegistryToken2,
14664
15267
  RegistryTokens: () => RegistryTokens,
15268
+ RevokeTokenRequest: () => RevokeTokenRequest,
15269
+ UpdateOrganizationRequest: () => UpdateOrganizationRequest,
14665
15270
  User: () => User,
14666
15271
  UserId: () => UserId2,
14667
15272
  commons: () => commons_exports2,
@@ -14678,6 +15283,10 @@ var init_serialization = __esm({
14678
15283
  init_serialization();
14679
15284
  // Annotate the CommonJS export names for ESM import in node:
14680
15285
  0 && (module.exports = {
15286
+ AddUserToOrgRequest,
15287
+ CheckRegistryPermissionRequest,
15288
+ CreateOrganizationRequest,
15289
+ GenerateRegistryTokensRequest,
14681
15290
  MavenRegistryToken,
14682
15291
  NpmRegistryToken,
14683
15292
  Organization,
@@ -14685,6 +15294,8 @@ init_serialization();
14685
15294
  OrganizationsPage,
14686
15295
  RegistryToken,
14687
15296
  RegistryTokens,
15297
+ RevokeTokenRequest,
15298
+ UpdateOrganizationRequest,
14688
15299
  User,
14689
15300
  UserId,
14690
15301
  commons,