@primitive.ai/prim 0.1.0-alpha.76 → 0.1.0-alpha.78

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.
@@ -6648,7 +6648,7 @@ function validate42(data, { instancePath = "", parentData, parentDataProperty, r
6648
6648
  return errors === 0;
6649
6649
  }
6650
6650
  validate42.evaluated = { "dynamicProps": true, "dynamicItems": false };
6651
- var schema77 = { "anyOf": [{ "type": "object", "properties": { "error": { "type": "string", "const": "Unauthorized" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "interactive_workos_authority_required" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "feature_disabled" }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "enum": ["github_connect_unavailable", "feature_check_unavailable"] }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "github_install_intent_conflict" } }, "required": ["error"], "additionalProperties": false }] };
6651
+ var schema77 = { "anyOf": [{ "type": "object", "properties": { "error": { "type": "string", "const": "Unauthorized" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "interactive_workos_authority_required" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "feature_disabled" }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "enum": ["github_connect_unavailable", "feature_check_unavailable"] }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "WorkOS identity authority is temporarily unavailable" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "github_install_intent_conflict" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "github_install_intent_rate_limited" }, "retryAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["error", "retryAt"], "additionalProperties": false }] };
6652
6652
  function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
6653
6653
  ;
6654
6654
  let vErrors = null;
@@ -7028,8 +7028,8 @@ function validate43(data, { instancePath = "", parentData, parentDataProperty, r
7028
7028
  }
7029
7029
  errors++;
7030
7030
  }
7031
- if ("github_install_intent_conflict" !== data6) {
7032
- const err27 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_conflict" }, message: "must be equal to constant" };
7031
+ if ("WorkOS identity authority is temporarily unavailable" !== data6) {
7032
+ const err27 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/const", keyword: "const", params: { allowedValue: "WorkOS identity authority is temporarily unavailable" }, message: "must be equal to constant" };
7033
7033
  if (vErrors === null) {
7034
7034
  vErrors = [err27];
7035
7035
  } else {
@@ -7057,12 +7057,191 @@ function validate43(data, { instancePath = "", parentData, parentDataProperty, r
7057
7057
  props0 = true;
7058
7058
  }
7059
7059
  }
7060
+ const _errs31 = errors;
7061
+ if (errors === _errs31) {
7062
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7063
+ let missing5;
7064
+ if (data.error === void 0 && (missing5 = "error")) {
7065
+ const err29 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
7066
+ if (vErrors === null) {
7067
+ vErrors = [err29];
7068
+ } else {
7069
+ vErrors.push(err29);
7070
+ }
7071
+ errors++;
7072
+ } else {
7073
+ const _errs33 = errors;
7074
+ for (const key5 in data) {
7075
+ if (!(key5 === "error")) {
7076
+ const err30 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
7077
+ if (vErrors === null) {
7078
+ vErrors = [err30];
7079
+ } else {
7080
+ vErrors.push(err30);
7081
+ }
7082
+ errors++;
7083
+ break;
7084
+ }
7085
+ }
7086
+ if (_errs33 === errors) {
7087
+ if (data.error !== void 0) {
7088
+ let data7 = data.error;
7089
+ if (typeof data7 !== "string") {
7090
+ const err31 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7091
+ if (vErrors === null) {
7092
+ vErrors = [err31];
7093
+ } else {
7094
+ vErrors.push(err31);
7095
+ }
7096
+ errors++;
7097
+ }
7098
+ if ("github_install_intent_conflict" !== data7) {
7099
+ const err32 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_conflict" }, message: "must be equal to constant" };
7100
+ if (vErrors === null) {
7101
+ vErrors = [err32];
7102
+ } else {
7103
+ vErrors.push(err32);
7104
+ }
7105
+ errors++;
7106
+ }
7107
+ }
7108
+ }
7109
+ }
7110
+ } else {
7111
+ const err33 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7112
+ if (vErrors === null) {
7113
+ vErrors = [err33];
7114
+ } else {
7115
+ vErrors.push(err33);
7116
+ }
7117
+ errors++;
7118
+ }
7119
+ }
7120
+ var _valid0 = _errs31 === errors;
7121
+ valid1 = valid1 || _valid0;
7122
+ if (_valid0) {
7123
+ if (props0 !== true) {
7124
+ props0 = true;
7125
+ }
7126
+ }
7127
+ const _errs36 = errors;
7128
+ if (errors === _errs36) {
7129
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7130
+ let missing6;
7131
+ if (data.error === void 0 && (missing6 = "error") || data.retryAt === void 0 && (missing6 = "retryAt")) {
7132
+ const err34 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" };
7133
+ if (vErrors === null) {
7134
+ vErrors = [err34];
7135
+ } else {
7136
+ vErrors.push(err34);
7137
+ }
7138
+ errors++;
7139
+ } else {
7140
+ const _errs38 = errors;
7141
+ for (const key6 in data) {
7142
+ if (!(key6 === "error" || key6 === "retryAt")) {
7143
+ const err35 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" };
7144
+ if (vErrors === null) {
7145
+ vErrors = [err35];
7146
+ } else {
7147
+ vErrors.push(err35);
7148
+ }
7149
+ errors++;
7150
+ break;
7151
+ }
7152
+ }
7153
+ if (_errs38 === errors) {
7154
+ if (data.error !== void 0) {
7155
+ let data8 = data.error;
7156
+ const _errs39 = errors;
7157
+ if (typeof data8 !== "string") {
7158
+ const err36 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7159
+ if (vErrors === null) {
7160
+ vErrors = [err36];
7161
+ } else {
7162
+ vErrors.push(err36);
7163
+ }
7164
+ errors++;
7165
+ }
7166
+ if ("github_install_intent_rate_limited" !== data8) {
7167
+ const err37 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_rate_limited" }, message: "must be equal to constant" };
7168
+ if (vErrors === null) {
7169
+ vErrors = [err37];
7170
+ } else {
7171
+ vErrors.push(err37);
7172
+ }
7173
+ errors++;
7174
+ }
7175
+ var valid8 = _errs39 === errors;
7176
+ } else {
7177
+ var valid8 = true;
7178
+ }
7179
+ if (valid8) {
7180
+ if (data.retryAt !== void 0) {
7181
+ let data9 = data.retryAt;
7182
+ const _errs41 = errors;
7183
+ if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
7184
+ const err38 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
7185
+ if (vErrors === null) {
7186
+ vErrors = [err38];
7187
+ } else {
7188
+ vErrors.push(err38);
7189
+ }
7190
+ errors++;
7191
+ }
7192
+ if (errors === _errs41) {
7193
+ if (typeof data9 == "number" && isFinite(data9)) {
7194
+ if (data9 > 9007199254740991 || isNaN(data9)) {
7195
+ const err39 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
7196
+ if (vErrors === null) {
7197
+ vErrors = [err39];
7198
+ } else {
7199
+ vErrors.push(err39);
7200
+ }
7201
+ errors++;
7202
+ } else {
7203
+ if (data9 < 0 || isNaN(data9)) {
7204
+ const err40 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
7205
+ if (vErrors === null) {
7206
+ vErrors = [err40];
7207
+ } else {
7208
+ vErrors.push(err40);
7209
+ }
7210
+ errors++;
7211
+ }
7212
+ }
7213
+ }
7214
+ }
7215
+ var valid8 = _errs41 === errors;
7216
+ } else {
7217
+ var valid8 = true;
7218
+ }
7219
+ }
7220
+ }
7221
+ }
7222
+ } else {
7223
+ const err41 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7224
+ if (vErrors === null) {
7225
+ vErrors = [err41];
7226
+ } else {
7227
+ vErrors.push(err41);
7228
+ }
7229
+ errors++;
7230
+ }
7231
+ }
7232
+ var _valid0 = _errs36 === errors;
7233
+ valid1 = valid1 || _valid0;
7234
+ if (_valid0) {
7235
+ if (props0 !== true) {
7236
+ props0 = true;
7237
+ }
7238
+ }
7060
7239
  if (!valid1) {
7061
- const err29 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7240
+ const err42 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7062
7241
  if (vErrors === null) {
7063
- vErrors = [err29];
7242
+ vErrors = [err42];
7064
7243
  } else {
7065
- vErrors.push(err29);
7244
+ vErrors.push(err42);
7066
7245
  }
7067
7246
  errors++;
7068
7247
  validate43.errors = vErrors;
@@ -7438,8 +7617,8 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
7438
7617
  }
7439
7618
  errors++;
7440
7619
  }
7441
- if ("github_install_intent_not_found" !== data2) {
7442
- const err13 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/2/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_not_found" }, message: "must be equal to constant" };
7620
+ if ("WorkOS identity authority is temporarily unavailable" !== data2) {
7621
+ const err13 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/2/properties/error/const", keyword: "const", params: { allowedValue: "WorkOS identity authority is temporarily unavailable" }, message: "must be equal to constant" };
7443
7622
  if (vErrors === null) {
7444
7623
  vErrors = [err13];
7445
7624
  } else {
@@ -7467,12 +7646,79 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
7467
7646
  props0 = true;
7468
7647
  }
7469
7648
  }
7649
+ const _errs17 = errors;
7650
+ if (errors === _errs17) {
7651
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7652
+ let missing3;
7653
+ if (data.error === void 0 && (missing3 = "error")) {
7654
+ const err15 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/3/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
7655
+ if (vErrors === null) {
7656
+ vErrors = [err15];
7657
+ } else {
7658
+ vErrors.push(err15);
7659
+ }
7660
+ errors++;
7661
+ } else {
7662
+ const _errs19 = errors;
7663
+ for (const key3 in data) {
7664
+ if (!(key3 === "error")) {
7665
+ const err16 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/3/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
7666
+ if (vErrors === null) {
7667
+ vErrors = [err16];
7668
+ } else {
7669
+ vErrors.push(err16);
7670
+ }
7671
+ errors++;
7672
+ break;
7673
+ }
7674
+ }
7675
+ if (_errs19 === errors) {
7676
+ if (data.error !== void 0) {
7677
+ let data3 = data.error;
7678
+ if (typeof data3 !== "string") {
7679
+ const err17 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/3/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7680
+ if (vErrors === null) {
7681
+ vErrors = [err17];
7682
+ } else {
7683
+ vErrors.push(err17);
7684
+ }
7685
+ errors++;
7686
+ }
7687
+ if ("github_install_intent_not_found" !== data3) {
7688
+ const err18 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/3/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_not_found" }, message: "must be equal to constant" };
7689
+ if (vErrors === null) {
7690
+ vErrors = [err18];
7691
+ } else {
7692
+ vErrors.push(err18);
7693
+ }
7694
+ errors++;
7695
+ }
7696
+ }
7697
+ }
7698
+ }
7699
+ } else {
7700
+ const err19 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf/3/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7701
+ if (vErrors === null) {
7702
+ vErrors = [err19];
7703
+ } else {
7704
+ vErrors.push(err19);
7705
+ }
7706
+ errors++;
7707
+ }
7708
+ }
7709
+ var _valid0 = _errs17 === errors;
7710
+ valid1 = valid1 || _valid0;
7711
+ if (_valid0) {
7712
+ if (props0 !== true) {
7713
+ props0 = true;
7714
+ }
7715
+ }
7470
7716
  if (!valid1) {
7471
- const err15 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7717
+ const err20 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7472
7718
  if (vErrors === null) {
7473
- vErrors = [err15];
7719
+ vErrors = [err20];
7474
7720
  } else {
7475
- vErrors.push(err15);
7721
+ vErrors.push(err20);
7476
7722
  }
7477
7723
  errors++;
7478
7724
  validate45.errors = vErrors;
@@ -7546,7 +7792,7 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
7546
7792
  return errors === 0;
7547
7793
  }
7548
7794
  validate46.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
7549
- var schema85 = { "anyOf": [{ "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status"], "additionalProperties": false }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "claimed" }, "leaseExpiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "leaseExpiresAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["claim_lease_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "consumed" }, "completedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "repositoryCount": { "type": "integer", "minimum": 1, "maximum": 256 }, "adminRepositoryCount": { "type": "integer", "minimum": 1, "maximum": 128 }, "nonAdminRepositoryCount": { "type": "integer", "minimum": 0, "maximum": 256 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "completedAt", "repositoryCount", "adminRepositoryCount", "nonAdminRepositoryCount"], "additionalProperties": false, "x-primitive-runtime-refinements": ["repository_count_partition", "completion_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "expired" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["expiry_not_before_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "cancelled" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["cancellation_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "failed_terminal" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "failureCode": { "type": "string", "enum": ["claim_lease_expired", "authority_changed", "oauth_exchange_failed", "installation_not_administered", "repository_enumeration_failed", "repository_bound_exceeded", "installation_changed", "proof_commit_failed"] } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt", "failureCode"], "additionalProperties": false, "x-primitive-runtime-refinements": ["terminal_failure_within_intent_ttl_except_claim_lease_expired"] }] };
7795
+ var schema85 = { "anyOf": [{ "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status"], "additionalProperties": false }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "claimed" }, "leaseExpiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "leaseExpiresAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["claim_lease_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "consumed" }, "completedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "repositoryCount": { "type": "integer", "minimum": 1, "maximum": 256 }, "adminRepositoryCount": { "type": "integer", "minimum": 1, "maximum": 128 }, "nonAdminRepositoryCount": { "type": "integer", "minimum": 0, "maximum": 256 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "completedAt", "repositoryCount", "adminRepositoryCount", "nonAdminRepositoryCount"], "additionalProperties": false, "x-primitive-runtime-refinements": ["repository_count_partition", "completion_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "expired" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["expiry_not_before_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "cancelled" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt"], "additionalProperties": false, "x-primitive-runtime-refinements": ["cancellation_within_intent_ttl"] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 1 }, "mode": { "type": "string", "const": "install_intent_v1" }, "found": { "type": "boolean", "const": true }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "failed_terminal" }, "closedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "failureCode": { "type": "string", "enum": ["claim_lease_expired", "authority_changed", "oauth_exchange_failed", "installation_not_administered", "repository_enumeration_failed", "repository_bound_exceeded", "installation_changed", "repository_identity_migration_required", "proof_commit_failed"] } }, "required": ["protocolVersion", "mode", "found", "expiresAt", "status", "closedAt", "failureCode"], "additionalProperties": false, "x-primitive-runtime-refinements": ["terminal_failure_within_intent_ttl_except_claim_lease_expired"] }] };
7550
7796
  var func32 = Object.prototype.hasOwnProperty;
7551
7797
  function validate47(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
7552
7798
  ;
@@ -9034,7 +9280,7 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
9034
9280
  }
9035
9281
  errors++;
9036
9282
  }
9037
- if (!(data38 === "claim_lease_expired" || data38 === "authority_changed" || data38 === "oauth_exchange_failed" || data38 === "installation_not_administered" || data38 === "repository_enumeration_failed" || data38 === "repository_bound_exceeded" || data38 === "installation_changed" || data38 === "proof_commit_failed")) {
9283
+ if (!(data38 === "claim_lease_expired" || data38 === "authority_changed" || data38 === "oauth_exchange_failed" || data38 === "installation_not_administered" || data38 === "repository_enumeration_failed" || data38 === "repository_bound_exceeded" || data38 === "installation_changed" || data38 === "repository_identity_migration_required" || data38 === "proof_commit_failed")) {
9038
9284
  const err108 = { instancePath: instancePath + "/failureCode", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStatusResponse/anyOf/5/properties/failureCode/enum", keyword: "enum", params: { allowedValues: schema85.anyOf[5].properties.failureCode.enum }, message: "must be equal to one of the allowed values" };
9039
9285
  if (vErrors === null) {
9040
9286
  vErrors = [err108];
@@ -10942,6 +11188,1736 @@ function validate54(data, { instancePath = "", parentData, parentDataProperty, r
10942
11188
  return errors === 0;
10943
11189
  }
10944
11190
  validate54.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
11191
+ var pattern17 = new RegExp("^[a-f0-9]{64}$", "u");
11192
+ var pattern18 = new RegExp("^api_key_[A-Za-z0-9_-]+$", "u");
11193
+ function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
11194
+ ;
11195
+ let vErrors = null;
11196
+ let errors = 0;
11197
+ const evaluated0 = validate55.evaluated;
11198
+ if (evaluated0.dynamicProps) {
11199
+ evaluated0.props = void 0;
11200
+ }
11201
+ if (evaluated0.dynamicItems) {
11202
+ evaluated0.items = void 0;
11203
+ }
11204
+ const _errs0 = errors;
11205
+ if (errors === _errs0) {
11206
+ if (data && typeof data == "object" && !Array.isArray(data)) {
11207
+ let missing0;
11208
+ if (data.requestId === void 0 && (missing0 = "requestId") || data.limit === void 0 && (missing0 = "limit")) {
11209
+ validate55.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
11210
+ return false;
11211
+ } else {
11212
+ const _errs2 = errors;
11213
+ for (const key0 in data) {
11214
+ if (!(key0 === "requestId" || key0 === "limit" || key0 === "after")) {
11215
+ validate55.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11216
+ return false;
11217
+ break;
11218
+ }
11219
+ }
11220
+ if (_errs2 === errors) {
11221
+ if (data.requestId !== void 0) {
11222
+ let data0 = data.requestId;
11223
+ const _errs3 = errors;
11224
+ if (errors === _errs3) {
11225
+ if (typeof data0 === "string") {
11226
+ if (!pattern17.test(data0)) {
11227
+ validate55.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/requestId/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' }];
11228
+ return false;
11229
+ }
11230
+ } else {
11231
+ validate55.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11232
+ return false;
11233
+ }
11234
+ }
11235
+ var valid1 = _errs3 === errors;
11236
+ } else {
11237
+ var valid1 = true;
11238
+ }
11239
+ if (valid1) {
11240
+ if (data.limit !== void 0) {
11241
+ let data1 = data.limit;
11242
+ const _errs5 = errors;
11243
+ if (!(typeof data1 == "number" && (!(data1 % 1) && !isNaN(data1)) && isFinite(data1))) {
11244
+ validate55.errors = [{ instancePath: instancePath + "/limit", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/limit/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
11245
+ return false;
11246
+ }
11247
+ if (errors === _errs5) {
11248
+ if (typeof data1 == "number" && isFinite(data1)) {
11249
+ if (data1 > 100 || isNaN(data1)) {
11250
+ validate55.errors = [{ instancePath: instancePath + "/limit", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/limit/maximum", keyword: "maximum", params: { comparison: "<=", limit: 100 }, message: "must be <= 100" }];
11251
+ return false;
11252
+ } else {
11253
+ if (data1 < 1 || isNaN(data1)) {
11254
+ validate55.errors = [{ instancePath: instancePath + "/limit", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/limit/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
11255
+ return false;
11256
+ }
11257
+ }
11258
+ }
11259
+ }
11260
+ var valid1 = _errs5 === errors;
11261
+ } else {
11262
+ var valid1 = true;
11263
+ }
11264
+ if (valid1) {
11265
+ if (data.after !== void 0) {
11266
+ let data2 = data.after;
11267
+ const _errs7 = errors;
11268
+ if (errors === _errs7) {
11269
+ if (typeof data2 === "string") {
11270
+ if (func1(data2) > 256) {
11271
+ validate55.errors = [{ instancePath: instancePath + "/after", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/after/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
11272
+ return false;
11273
+ } else {
11274
+ if (func1(data2) < 9) {
11275
+ validate55.errors = [{ instancePath: instancePath + "/after", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/after/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" }];
11276
+ return false;
11277
+ } else {
11278
+ if (!pattern18.test(data2)) {
11279
+ validate55.errors = [{ instancePath: instancePath + "/after", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/after/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' }];
11280
+ return false;
11281
+ }
11282
+ }
11283
+ }
11284
+ } else {
11285
+ validate55.errors = [{ instancePath: instancePath + "/after", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/properties/after/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11286
+ return false;
11287
+ }
11288
+ }
11289
+ var valid1 = _errs7 === errors;
11290
+ } else {
11291
+ var valid1 = true;
11292
+ }
11293
+ }
11294
+ }
11295
+ }
11296
+ }
11297
+ } else {
11298
+ validate55.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListRequest/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11299
+ return false;
11300
+ }
11301
+ }
11302
+ validate55.errors = vErrors;
11303
+ return errors === 0;
11304
+ }
11305
+ validate55.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
11306
+ var pattern20 = new RegExp("^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$", "u");
11307
+ var pattern21 = new RegExp("^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$", "u");
11308
+ var pattern22 = new RegExp("^[\\x21-\\x7e]+$", "u");
11309
+ function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
11310
+ ;
11311
+ let vErrors = null;
11312
+ let errors = 0;
11313
+ const evaluated0 = validate56.evaluated;
11314
+ if (evaluated0.dynamicProps) {
11315
+ evaluated0.props = void 0;
11316
+ }
11317
+ if (evaluated0.dynamicItems) {
11318
+ evaluated0.items = void 0;
11319
+ }
11320
+ const _errs0 = errors;
11321
+ if (errors === _errs0) {
11322
+ if (data && typeof data == "object" && !Array.isArray(data)) {
11323
+ let missing0;
11324
+ if (data.apiKeys === void 0 && (missing0 = "apiKeys") || data.nextCursor === void 0 && (missing0 = "nextCursor")) {
11325
+ validate56.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
11326
+ return false;
11327
+ } else {
11328
+ const _errs2 = errors;
11329
+ for (const key0 in data) {
11330
+ if (!(key0 === "apiKeys" || key0 === "nextCursor")) {
11331
+ validate56.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11332
+ return false;
11333
+ break;
11334
+ }
11335
+ }
11336
+ if (_errs2 === errors) {
11337
+ if (data.apiKeys !== void 0) {
11338
+ let data0 = data.apiKeys;
11339
+ const _errs3 = errors;
11340
+ if (errors === _errs3) {
11341
+ if (Array.isArray(data0)) {
11342
+ if (data0.length > 100) {
11343
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
11344
+ return false;
11345
+ } else {
11346
+ var valid2 = true;
11347
+ const len0 = data0.length;
11348
+ for (let i0 = 0; i0 < len0; i0++) {
11349
+ let data1 = data0[i0];
11350
+ const _errs5 = errors;
11351
+ if (errors === _errs5) {
11352
+ if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
11353
+ let missing1;
11354
+ if (data1.id === void 0 && (missing1 = "id") || data1.name === void 0 && (missing1 = "name") || data1.obfuscatedValue === void 0 && (missing1 = "obfuscatedValue") || data1.permissions === void 0 && (missing1 = "permissions") || data1.lastUsedAt === void 0 && (missing1 = "lastUsedAt") || data1.expiresAt === void 0 && (missing1 = "expiresAt") || data1.createdAt === void 0 && (missing1 = "createdAt") || data1.updatedAt === void 0 && (missing1 = "updatedAt")) {
11355
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
11356
+ return false;
11357
+ } else {
11358
+ const _errs7 = errors;
11359
+ for (const key1 in data1) {
11360
+ if (!(key1 === "id" || key1 === "name" || key1 === "obfuscatedValue" || key1 === "permissions" || key1 === "lastUsedAt" || key1 === "expiresAt" || key1 === "createdAt" || key1 === "updatedAt")) {
11361
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
11362
+ return false;
11363
+ break;
11364
+ }
11365
+ }
11366
+ if (_errs7 === errors) {
11367
+ if (data1.id !== void 0) {
11368
+ let data2 = data1.id;
11369
+ const _errs8 = errors;
11370
+ if (errors === _errs8) {
11371
+ if (typeof data2 === "string") {
11372
+ if (func1(data2) > 256) {
11373
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/id/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
11374
+ return false;
11375
+ } else {
11376
+ if (func1(data2) < 9) {
11377
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/id/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" }];
11378
+ return false;
11379
+ } else {
11380
+ if (!pattern18.test(data2)) {
11381
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/id/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' }];
11382
+ return false;
11383
+ }
11384
+ }
11385
+ }
11386
+ } else {
11387
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11388
+ return false;
11389
+ }
11390
+ }
11391
+ var valid3 = _errs8 === errors;
11392
+ } else {
11393
+ var valid3 = true;
11394
+ }
11395
+ if (valid3) {
11396
+ if (data1.name !== void 0) {
11397
+ let data3 = data1.name;
11398
+ const _errs10 = errors;
11399
+ if (errors === _errs10) {
11400
+ if (typeof data3 === "string") {
11401
+ if (func1(data3) > 128) {
11402
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/name/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
11403
+ return false;
11404
+ } else {
11405
+ if (func1(data3) < 1) {
11406
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/name/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11407
+ return false;
11408
+ } else {
11409
+ if (!pattern20.test(data3)) {
11410
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/name/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$" }, message: 'must match pattern "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$"' }];
11411
+ return false;
11412
+ }
11413
+ }
11414
+ }
11415
+ } else {
11416
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11417
+ return false;
11418
+ }
11419
+ }
11420
+ var valid3 = _errs10 === errors;
11421
+ } else {
11422
+ var valid3 = true;
11423
+ }
11424
+ if (valid3) {
11425
+ if (data1.obfuscatedValue !== void 0) {
11426
+ let data4 = data1.obfuscatedValue;
11427
+ const _errs12 = errors;
11428
+ if (errors === _errs12) {
11429
+ if (typeof data4 === "string") {
11430
+ if (func1(data4) > 256) {
11431
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/obfuscatedValue/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
11432
+ return false;
11433
+ } else {
11434
+ if (func1(data4) < 1) {
11435
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/obfuscatedValue/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11436
+ return false;
11437
+ } else {
11438
+ if (!pattern21.test(data4)) {
11439
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/obfuscatedValue/pattern", keyword: "pattern", params: { pattern: "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$" }, message: 'must match pattern "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$"' }];
11440
+ return false;
11441
+ }
11442
+ }
11443
+ }
11444
+ } else {
11445
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/obfuscatedValue/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11446
+ return false;
11447
+ }
11448
+ }
11449
+ var valid3 = _errs12 === errors;
11450
+ } else {
11451
+ var valid3 = true;
11452
+ }
11453
+ if (valid3) {
11454
+ if (data1.permissions !== void 0) {
11455
+ let data5 = data1.permissions;
11456
+ const _errs14 = errors;
11457
+ if (errors === _errs14) {
11458
+ if (Array.isArray(data5)) {
11459
+ if (data5.length > 100) {
11460
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
11461
+ return false;
11462
+ } else {
11463
+ var valid4 = true;
11464
+ const len1 = data5.length;
11465
+ for (let i1 = 0; i1 < len1; i1++) {
11466
+ let data6 = data5[i1];
11467
+ const _errs16 = errors;
11468
+ if (errors === _errs16) {
11469
+ if (typeof data6 === "string") {
11470
+ if (func1(data6) > 128) {
11471
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions/" + i1, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/items/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
11472
+ return false;
11473
+ } else {
11474
+ if (func1(data6) < 1) {
11475
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions/" + i1, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11476
+ return false;
11477
+ } else {
11478
+ if (!pattern22.test(data6)) {
11479
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions/" + i1, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/items/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e]+$" }, message: 'must match pattern "^[\\x21-\\x7e]+$"' }];
11480
+ return false;
11481
+ }
11482
+ }
11483
+ }
11484
+ } else {
11485
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions/" + i1, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11486
+ return false;
11487
+ }
11488
+ }
11489
+ var valid4 = _errs16 === errors;
11490
+ if (!valid4) {
11491
+ break;
11492
+ }
11493
+ }
11494
+ }
11495
+ } else {
11496
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/permissions/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11497
+ return false;
11498
+ }
11499
+ }
11500
+ var valid3 = _errs14 === errors;
11501
+ } else {
11502
+ var valid3 = true;
11503
+ }
11504
+ if (valid3) {
11505
+ if (data1.lastUsedAt !== void 0) {
11506
+ let data7 = data1.lastUsedAt;
11507
+ const _errs18 = errors;
11508
+ const _errs19 = errors;
11509
+ let valid5 = false;
11510
+ const _errs20 = errors;
11511
+ if (!(typeof data7 == "number" && (!(data7 % 1) && !isNaN(data7)) && isFinite(data7))) {
11512
+ const err0 = { instancePath: instancePath + "/apiKeys/" + i0 + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/lastUsedAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
11513
+ if (vErrors === null) {
11514
+ vErrors = [err0];
11515
+ } else {
11516
+ vErrors.push(err0);
11517
+ }
11518
+ errors++;
11519
+ }
11520
+ if (errors === _errs20) {
11521
+ if (typeof data7 == "number" && isFinite(data7)) {
11522
+ if (data7 > 9007199254740991 || isNaN(data7)) {
11523
+ const err1 = { instancePath: instancePath + "/apiKeys/" + i0 + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/lastUsedAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
11524
+ if (vErrors === null) {
11525
+ vErrors = [err1];
11526
+ } else {
11527
+ vErrors.push(err1);
11528
+ }
11529
+ errors++;
11530
+ } else {
11531
+ if (data7 < 0 || isNaN(data7)) {
11532
+ const err2 = { instancePath: instancePath + "/apiKeys/" + i0 + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/lastUsedAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
11533
+ if (vErrors === null) {
11534
+ vErrors = [err2];
11535
+ } else {
11536
+ vErrors.push(err2);
11537
+ }
11538
+ errors++;
11539
+ }
11540
+ }
11541
+ }
11542
+ }
11543
+ var _valid0 = _errs20 === errors;
11544
+ valid5 = valid5 || _valid0;
11545
+ const _errs22 = errors;
11546
+ if (data7 !== null) {
11547
+ const err3 = { instancePath: instancePath + "/apiKeys/" + i0 + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/lastUsedAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
11548
+ if (vErrors === null) {
11549
+ vErrors = [err3];
11550
+ } else {
11551
+ vErrors.push(err3);
11552
+ }
11553
+ errors++;
11554
+ }
11555
+ var _valid0 = _errs22 === errors;
11556
+ valid5 = valid5 || _valid0;
11557
+ if (!valid5) {
11558
+ const err4 = { instancePath: instancePath + "/apiKeys/" + i0 + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/lastUsedAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
11559
+ if (vErrors === null) {
11560
+ vErrors = [err4];
11561
+ } else {
11562
+ vErrors.push(err4);
11563
+ }
11564
+ errors++;
11565
+ validate56.errors = vErrors;
11566
+ return false;
11567
+ } else {
11568
+ errors = _errs19;
11569
+ if (vErrors !== null) {
11570
+ if (_errs19) {
11571
+ vErrors.length = _errs19;
11572
+ } else {
11573
+ vErrors = null;
11574
+ }
11575
+ }
11576
+ }
11577
+ var valid3 = _errs18 === errors;
11578
+ } else {
11579
+ var valid3 = true;
11580
+ }
11581
+ if (valid3) {
11582
+ if (data1.expiresAt !== void 0) {
11583
+ let data8 = data1.expiresAt;
11584
+ const _errs24 = errors;
11585
+ const _errs25 = errors;
11586
+ let valid6 = false;
11587
+ const _errs26 = errors;
11588
+ if (!(typeof data8 == "number" && (!(data8 % 1) && !isNaN(data8)) && isFinite(data8))) {
11589
+ const err5 = { instancePath: instancePath + "/apiKeys/" + i0 + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/expiresAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
11590
+ if (vErrors === null) {
11591
+ vErrors = [err5];
11592
+ } else {
11593
+ vErrors.push(err5);
11594
+ }
11595
+ errors++;
11596
+ }
11597
+ if (errors === _errs26) {
11598
+ if (typeof data8 == "number" && isFinite(data8)) {
11599
+ if (data8 > 9007199254740991 || isNaN(data8)) {
11600
+ const err6 = { instancePath: instancePath + "/apiKeys/" + i0 + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/expiresAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
11601
+ if (vErrors === null) {
11602
+ vErrors = [err6];
11603
+ } else {
11604
+ vErrors.push(err6);
11605
+ }
11606
+ errors++;
11607
+ } else {
11608
+ if (data8 < 0 || isNaN(data8)) {
11609
+ const err7 = { instancePath: instancePath + "/apiKeys/" + i0 + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/expiresAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
11610
+ if (vErrors === null) {
11611
+ vErrors = [err7];
11612
+ } else {
11613
+ vErrors.push(err7);
11614
+ }
11615
+ errors++;
11616
+ }
11617
+ }
11618
+ }
11619
+ }
11620
+ var _valid1 = _errs26 === errors;
11621
+ valid6 = valid6 || _valid1;
11622
+ const _errs28 = errors;
11623
+ if (data8 !== null) {
11624
+ const err8 = { instancePath: instancePath + "/apiKeys/" + i0 + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/expiresAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
11625
+ if (vErrors === null) {
11626
+ vErrors = [err8];
11627
+ } else {
11628
+ vErrors.push(err8);
11629
+ }
11630
+ errors++;
11631
+ }
11632
+ var _valid1 = _errs28 === errors;
11633
+ valid6 = valid6 || _valid1;
11634
+ if (!valid6) {
11635
+ const err9 = { instancePath: instancePath + "/apiKeys/" + i0 + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/expiresAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
11636
+ if (vErrors === null) {
11637
+ vErrors = [err9];
11638
+ } else {
11639
+ vErrors.push(err9);
11640
+ }
11641
+ errors++;
11642
+ validate56.errors = vErrors;
11643
+ return false;
11644
+ } else {
11645
+ errors = _errs25;
11646
+ if (vErrors !== null) {
11647
+ if (_errs25) {
11648
+ vErrors.length = _errs25;
11649
+ } else {
11650
+ vErrors = null;
11651
+ }
11652
+ }
11653
+ }
11654
+ var valid3 = _errs24 === errors;
11655
+ } else {
11656
+ var valid3 = true;
11657
+ }
11658
+ if (valid3) {
11659
+ if (data1.createdAt !== void 0) {
11660
+ let data9 = data1.createdAt;
11661
+ const _errs30 = errors;
11662
+ if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
11663
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/createdAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
11664
+ return false;
11665
+ }
11666
+ if (errors === _errs30) {
11667
+ if (typeof data9 == "number" && isFinite(data9)) {
11668
+ if (data9 > 9007199254740991 || isNaN(data9)) {
11669
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/createdAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
11670
+ return false;
11671
+ } else {
11672
+ if (data9 < 0 || isNaN(data9)) {
11673
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/createdAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
11674
+ return false;
11675
+ }
11676
+ }
11677
+ }
11678
+ }
11679
+ var valid3 = _errs30 === errors;
11680
+ } else {
11681
+ var valid3 = true;
11682
+ }
11683
+ if (valid3) {
11684
+ if (data1.updatedAt !== void 0) {
11685
+ let data10 = data1.updatedAt;
11686
+ const _errs32 = errors;
11687
+ if (!(typeof data10 == "number" && (!(data10 % 1) && !isNaN(data10)) && isFinite(data10))) {
11688
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/updatedAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
11689
+ return false;
11690
+ }
11691
+ if (errors === _errs32) {
11692
+ if (typeof data10 == "number" && isFinite(data10)) {
11693
+ if (data10 > 9007199254740991 || isNaN(data10)) {
11694
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/updatedAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
11695
+ return false;
11696
+ } else {
11697
+ if (data10 < 0 || isNaN(data10)) {
11698
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0 + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/properties/updatedAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
11699
+ return false;
11700
+ }
11701
+ }
11702
+ }
11703
+ }
11704
+ var valid3 = _errs32 === errors;
11705
+ } else {
11706
+ var valid3 = true;
11707
+ }
11708
+ }
11709
+ }
11710
+ }
11711
+ }
11712
+ }
11713
+ }
11714
+ }
11715
+ }
11716
+ }
11717
+ } else {
11718
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11719
+ return false;
11720
+ }
11721
+ }
11722
+ var valid2 = _errs5 === errors;
11723
+ if (!valid2) {
11724
+ break;
11725
+ }
11726
+ }
11727
+ }
11728
+ } else {
11729
+ validate56.errors = [{ instancePath: instancePath + "/apiKeys", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/apiKeys/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11730
+ return false;
11731
+ }
11732
+ }
11733
+ var valid1 = _errs3 === errors;
11734
+ } else {
11735
+ var valid1 = true;
11736
+ }
11737
+ if (valid1) {
11738
+ if (data.nextCursor !== void 0) {
11739
+ let data11 = data.nextCursor;
11740
+ const _errs34 = errors;
11741
+ const _errs35 = errors;
11742
+ let valid7 = false;
11743
+ const _errs36 = errors;
11744
+ if (errors === _errs36) {
11745
+ if (typeof data11 === "string") {
11746
+ if (func1(data11) > 256) {
11747
+ const err10 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf/0/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" };
11748
+ if (vErrors === null) {
11749
+ vErrors = [err10];
11750
+ } else {
11751
+ vErrors.push(err10);
11752
+ }
11753
+ errors++;
11754
+ } else {
11755
+ if (func1(data11) < 9) {
11756
+ const err11 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf/0/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" };
11757
+ if (vErrors === null) {
11758
+ vErrors = [err11];
11759
+ } else {
11760
+ vErrors.push(err11);
11761
+ }
11762
+ errors++;
11763
+ } else {
11764
+ if (!pattern18.test(data11)) {
11765
+ const err12 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf/0/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' };
11766
+ if (vErrors === null) {
11767
+ vErrors = [err12];
11768
+ } else {
11769
+ vErrors.push(err12);
11770
+ }
11771
+ errors++;
11772
+ }
11773
+ }
11774
+ }
11775
+ } else {
11776
+ const err13 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11777
+ if (vErrors === null) {
11778
+ vErrors = [err13];
11779
+ } else {
11780
+ vErrors.push(err13);
11781
+ }
11782
+ errors++;
11783
+ }
11784
+ }
11785
+ var _valid2 = _errs36 === errors;
11786
+ valid7 = valid7 || _valid2;
11787
+ const _errs38 = errors;
11788
+ if (data11 !== null) {
11789
+ const err14 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
11790
+ if (vErrors === null) {
11791
+ vErrors = [err14];
11792
+ } else {
11793
+ vErrors.push(err14);
11794
+ }
11795
+ errors++;
11796
+ }
11797
+ var _valid2 = _errs38 === errors;
11798
+ valid7 = valid7 || _valid2;
11799
+ if (!valid7) {
11800
+ const err15 = { instancePath: instancePath + "/nextCursor", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/properties/nextCursor/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
11801
+ if (vErrors === null) {
11802
+ vErrors = [err15];
11803
+ } else {
11804
+ vErrors.push(err15);
11805
+ }
11806
+ errors++;
11807
+ validate56.errors = vErrors;
11808
+ return false;
11809
+ } else {
11810
+ errors = _errs35;
11811
+ if (vErrors !== null) {
11812
+ if (_errs35) {
11813
+ vErrors.length = _errs35;
11814
+ } else {
11815
+ vErrors = null;
11816
+ }
11817
+ }
11818
+ }
11819
+ var valid1 = _errs34 === errors;
11820
+ } else {
11821
+ var valid1 = true;
11822
+ }
11823
+ }
11824
+ }
11825
+ }
11826
+ } else {
11827
+ validate56.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyListResponse/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11828
+ return false;
11829
+ }
11830
+ }
11831
+ validate56.errors = vErrors;
11832
+ return errors === 0;
11833
+ }
11834
+ validate56.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
11835
+ function validate57(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
11836
+ ;
11837
+ let vErrors = null;
11838
+ let errors = 0;
11839
+ const evaluated0 = validate57.evaluated;
11840
+ if (evaluated0.dynamicProps) {
11841
+ evaluated0.props = void 0;
11842
+ }
11843
+ if (evaluated0.dynamicItems) {
11844
+ evaluated0.items = void 0;
11845
+ }
11846
+ const _errs0 = errors;
11847
+ if (errors === _errs0) {
11848
+ if (data && typeof data == "object" && !Array.isArray(data)) {
11849
+ let missing0;
11850
+ if (data.id === void 0 && (missing0 = "id") || data.name === void 0 && (missing0 = "name") || data.obfuscatedValue === void 0 && (missing0 = "obfuscatedValue") || data.permissions === void 0 && (missing0 = "permissions") || data.lastUsedAt === void 0 && (missing0 = "lastUsedAt") || data.expiresAt === void 0 && (missing0 = "expiresAt") || data.createdAt === void 0 && (missing0 = "createdAt") || data.updatedAt === void 0 && (missing0 = "updatedAt")) {
11851
+ validate57.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
11852
+ return false;
11853
+ } else {
11854
+ const _errs2 = errors;
11855
+ for (const key0 in data) {
11856
+ if (!(key0 === "id" || key0 === "name" || key0 === "obfuscatedValue" || key0 === "permissions" || key0 === "lastUsedAt" || key0 === "expiresAt" || key0 === "createdAt" || key0 === "updatedAt")) {
11857
+ validate57.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11858
+ return false;
11859
+ break;
11860
+ }
11861
+ }
11862
+ if (_errs2 === errors) {
11863
+ if (data.id !== void 0) {
11864
+ let data0 = data.id;
11865
+ const _errs3 = errors;
11866
+ if (errors === _errs3) {
11867
+ if (typeof data0 === "string") {
11868
+ if (func1(data0) > 256) {
11869
+ validate57.errors = [{ instancePath: instancePath + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/id/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
11870
+ return false;
11871
+ } else {
11872
+ if (func1(data0) < 9) {
11873
+ validate57.errors = [{ instancePath: instancePath + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/id/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" }];
11874
+ return false;
11875
+ } else {
11876
+ if (!pattern18.test(data0)) {
11877
+ validate57.errors = [{ instancePath: instancePath + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/id/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' }];
11878
+ return false;
11879
+ }
11880
+ }
11881
+ }
11882
+ } else {
11883
+ validate57.errors = [{ instancePath: instancePath + "/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11884
+ return false;
11885
+ }
11886
+ }
11887
+ var valid1 = _errs3 === errors;
11888
+ } else {
11889
+ var valid1 = true;
11890
+ }
11891
+ if (valid1) {
11892
+ if (data.name !== void 0) {
11893
+ let data1 = data.name;
11894
+ const _errs5 = errors;
11895
+ if (errors === _errs5) {
11896
+ if (typeof data1 === "string") {
11897
+ if (func1(data1) > 128) {
11898
+ validate57.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/name/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
11899
+ return false;
11900
+ } else {
11901
+ if (func1(data1) < 1) {
11902
+ validate57.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/name/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11903
+ return false;
11904
+ } else {
11905
+ if (!pattern20.test(data1)) {
11906
+ validate57.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/name/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$" }, message: 'must match pattern "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$"' }];
11907
+ return false;
11908
+ }
11909
+ }
11910
+ }
11911
+ } else {
11912
+ validate57.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11913
+ return false;
11914
+ }
11915
+ }
11916
+ var valid1 = _errs5 === errors;
11917
+ } else {
11918
+ var valid1 = true;
11919
+ }
11920
+ if (valid1) {
11921
+ if (data.obfuscatedValue !== void 0) {
11922
+ let data2 = data.obfuscatedValue;
11923
+ const _errs7 = errors;
11924
+ if (errors === _errs7) {
11925
+ if (typeof data2 === "string") {
11926
+ if (func1(data2) > 256) {
11927
+ validate57.errors = [{ instancePath: instancePath + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/obfuscatedValue/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
11928
+ return false;
11929
+ } else {
11930
+ if (func1(data2) < 1) {
11931
+ validate57.errors = [{ instancePath: instancePath + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/obfuscatedValue/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11932
+ return false;
11933
+ } else {
11934
+ if (!pattern21.test(data2)) {
11935
+ validate57.errors = [{ instancePath: instancePath + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/obfuscatedValue/pattern", keyword: "pattern", params: { pattern: "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$" }, message: 'must match pattern "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$"' }];
11936
+ return false;
11937
+ }
11938
+ }
11939
+ }
11940
+ } else {
11941
+ validate57.errors = [{ instancePath: instancePath + "/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/obfuscatedValue/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11942
+ return false;
11943
+ }
11944
+ }
11945
+ var valid1 = _errs7 === errors;
11946
+ } else {
11947
+ var valid1 = true;
11948
+ }
11949
+ if (valid1) {
11950
+ if (data.permissions !== void 0) {
11951
+ let data3 = data.permissions;
11952
+ const _errs9 = errors;
11953
+ if (errors === _errs9) {
11954
+ if (Array.isArray(data3)) {
11955
+ if (data3.length > 100) {
11956
+ validate57.errors = [{ instancePath: instancePath + "/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
11957
+ return false;
11958
+ } else {
11959
+ var valid2 = true;
11960
+ const len0 = data3.length;
11961
+ for (let i0 = 0; i0 < len0; i0++) {
11962
+ let data4 = data3[i0];
11963
+ const _errs11 = errors;
11964
+ if (errors === _errs11) {
11965
+ if (typeof data4 === "string") {
11966
+ if (func1(data4) > 128) {
11967
+ validate57.errors = [{ instancePath: instancePath + "/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/items/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
11968
+ return false;
11969
+ } else {
11970
+ if (func1(data4) < 1) {
11971
+ validate57.errors = [{ instancePath: instancePath + "/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
11972
+ return false;
11973
+ } else {
11974
+ if (!pattern22.test(data4)) {
11975
+ validate57.errors = [{ instancePath: instancePath + "/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/items/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e]+$" }, message: 'must match pattern "^[\\x21-\\x7e]+$"' }];
11976
+ return false;
11977
+ }
11978
+ }
11979
+ }
11980
+ } else {
11981
+ validate57.errors = [{ instancePath: instancePath + "/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11982
+ return false;
11983
+ }
11984
+ }
11985
+ var valid2 = _errs11 === errors;
11986
+ if (!valid2) {
11987
+ break;
11988
+ }
11989
+ }
11990
+ }
11991
+ } else {
11992
+ validate57.errors = [{ instancePath: instancePath + "/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/permissions/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11993
+ return false;
11994
+ }
11995
+ }
11996
+ var valid1 = _errs9 === errors;
11997
+ } else {
11998
+ var valid1 = true;
11999
+ }
12000
+ if (valid1) {
12001
+ if (data.lastUsedAt !== void 0) {
12002
+ let data5 = data.lastUsedAt;
12003
+ const _errs13 = errors;
12004
+ const _errs14 = errors;
12005
+ let valid3 = false;
12006
+ const _errs15 = errors;
12007
+ if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)) && isFinite(data5))) {
12008
+ const err0 = { instancePath: instancePath + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/lastUsedAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
12009
+ if (vErrors === null) {
12010
+ vErrors = [err0];
12011
+ } else {
12012
+ vErrors.push(err0);
12013
+ }
12014
+ errors++;
12015
+ }
12016
+ if (errors === _errs15) {
12017
+ if (typeof data5 == "number" && isFinite(data5)) {
12018
+ if (data5 > 9007199254740991 || isNaN(data5)) {
12019
+ const err1 = { instancePath: instancePath + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/lastUsedAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
12020
+ if (vErrors === null) {
12021
+ vErrors = [err1];
12022
+ } else {
12023
+ vErrors.push(err1);
12024
+ }
12025
+ errors++;
12026
+ } else {
12027
+ if (data5 < 0 || isNaN(data5)) {
12028
+ const err2 = { instancePath: instancePath + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/lastUsedAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
12029
+ if (vErrors === null) {
12030
+ vErrors = [err2];
12031
+ } else {
12032
+ vErrors.push(err2);
12033
+ }
12034
+ errors++;
12035
+ }
12036
+ }
12037
+ }
12038
+ }
12039
+ var _valid0 = _errs15 === errors;
12040
+ valid3 = valid3 || _valid0;
12041
+ const _errs17 = errors;
12042
+ if (data5 !== null) {
12043
+ const err3 = { instancePath: instancePath + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/lastUsedAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
12044
+ if (vErrors === null) {
12045
+ vErrors = [err3];
12046
+ } else {
12047
+ vErrors.push(err3);
12048
+ }
12049
+ errors++;
12050
+ }
12051
+ var _valid0 = _errs17 === errors;
12052
+ valid3 = valid3 || _valid0;
12053
+ if (!valid3) {
12054
+ const err4 = { instancePath: instancePath + "/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/lastUsedAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
12055
+ if (vErrors === null) {
12056
+ vErrors = [err4];
12057
+ } else {
12058
+ vErrors.push(err4);
12059
+ }
12060
+ errors++;
12061
+ validate57.errors = vErrors;
12062
+ return false;
12063
+ } else {
12064
+ errors = _errs14;
12065
+ if (vErrors !== null) {
12066
+ if (_errs14) {
12067
+ vErrors.length = _errs14;
12068
+ } else {
12069
+ vErrors = null;
12070
+ }
12071
+ }
12072
+ }
12073
+ var valid1 = _errs13 === errors;
12074
+ } else {
12075
+ var valid1 = true;
12076
+ }
12077
+ if (valid1) {
12078
+ if (data.expiresAt !== void 0) {
12079
+ let data6 = data.expiresAt;
12080
+ const _errs19 = errors;
12081
+ const _errs20 = errors;
12082
+ let valid4 = false;
12083
+ const _errs21 = errors;
12084
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6)) && isFinite(data6))) {
12085
+ const err5 = { instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/expiresAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
12086
+ if (vErrors === null) {
12087
+ vErrors = [err5];
12088
+ } else {
12089
+ vErrors.push(err5);
12090
+ }
12091
+ errors++;
12092
+ }
12093
+ if (errors === _errs21) {
12094
+ if (typeof data6 == "number" && isFinite(data6)) {
12095
+ if (data6 > 9007199254740991 || isNaN(data6)) {
12096
+ const err6 = { instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/expiresAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
12097
+ if (vErrors === null) {
12098
+ vErrors = [err6];
12099
+ } else {
12100
+ vErrors.push(err6);
12101
+ }
12102
+ errors++;
12103
+ } else {
12104
+ if (data6 < 0 || isNaN(data6)) {
12105
+ const err7 = { instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/expiresAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
12106
+ if (vErrors === null) {
12107
+ vErrors = [err7];
12108
+ } else {
12109
+ vErrors.push(err7);
12110
+ }
12111
+ errors++;
12112
+ }
12113
+ }
12114
+ }
12115
+ }
12116
+ var _valid1 = _errs21 === errors;
12117
+ valid4 = valid4 || _valid1;
12118
+ const _errs23 = errors;
12119
+ if (data6 !== null) {
12120
+ const err8 = { instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/expiresAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
12121
+ if (vErrors === null) {
12122
+ vErrors = [err8];
12123
+ } else {
12124
+ vErrors.push(err8);
12125
+ }
12126
+ errors++;
12127
+ }
12128
+ var _valid1 = _errs23 === errors;
12129
+ valid4 = valid4 || _valid1;
12130
+ if (!valid4) {
12131
+ const err9 = { instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/expiresAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
12132
+ if (vErrors === null) {
12133
+ vErrors = [err9];
12134
+ } else {
12135
+ vErrors.push(err9);
12136
+ }
12137
+ errors++;
12138
+ validate57.errors = vErrors;
12139
+ return false;
12140
+ } else {
12141
+ errors = _errs20;
12142
+ if (vErrors !== null) {
12143
+ if (_errs20) {
12144
+ vErrors.length = _errs20;
12145
+ } else {
12146
+ vErrors = null;
12147
+ }
12148
+ }
12149
+ }
12150
+ var valid1 = _errs19 === errors;
12151
+ } else {
12152
+ var valid1 = true;
12153
+ }
12154
+ if (valid1) {
12155
+ if (data.createdAt !== void 0) {
12156
+ let data7 = data.createdAt;
12157
+ const _errs25 = errors;
12158
+ if (!(typeof data7 == "number" && (!(data7 % 1) && !isNaN(data7)) && isFinite(data7))) {
12159
+ validate57.errors = [{ instancePath: instancePath + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/createdAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
12160
+ return false;
12161
+ }
12162
+ if (errors === _errs25) {
12163
+ if (typeof data7 == "number" && isFinite(data7)) {
12164
+ if (data7 > 9007199254740991 || isNaN(data7)) {
12165
+ validate57.errors = [{ instancePath: instancePath + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/createdAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
12166
+ return false;
12167
+ } else {
12168
+ if (data7 < 0 || isNaN(data7)) {
12169
+ validate57.errors = [{ instancePath: instancePath + "/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/createdAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
12170
+ return false;
12171
+ }
12172
+ }
12173
+ }
12174
+ }
12175
+ var valid1 = _errs25 === errors;
12176
+ } else {
12177
+ var valid1 = true;
12178
+ }
12179
+ if (valid1) {
12180
+ if (data.updatedAt !== void 0) {
12181
+ let data8 = data.updatedAt;
12182
+ const _errs27 = errors;
12183
+ if (!(typeof data8 == "number" && (!(data8 % 1) && !isNaN(data8)) && isFinite(data8))) {
12184
+ validate57.errors = [{ instancePath: instancePath + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/updatedAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
12185
+ return false;
12186
+ }
12187
+ if (errors === _errs27) {
12188
+ if (typeof data8 == "number" && isFinite(data8)) {
12189
+ if (data8 > 9007199254740991 || isNaN(data8)) {
12190
+ validate57.errors = [{ instancePath: instancePath + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/updatedAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
12191
+ return false;
12192
+ } else {
12193
+ if (data8 < 0 || isNaN(data8)) {
12194
+ validate57.errors = [{ instancePath: instancePath + "/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/properties/updatedAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
12195
+ return false;
12196
+ }
12197
+ }
12198
+ }
12199
+ }
12200
+ var valid1 = _errs27 === errors;
12201
+ } else {
12202
+ var valid1 = true;
12203
+ }
12204
+ }
12205
+ }
12206
+ }
12207
+ }
12208
+ }
12209
+ }
12210
+ }
12211
+ }
12212
+ }
12213
+ } else {
12214
+ validate57.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMetadata/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12215
+ return false;
12216
+ }
12217
+ }
12218
+ validate57.errors = vErrors;
12219
+ return errors === 0;
12220
+ }
12221
+ validate57.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12222
+ function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12223
+ ;
12224
+ let vErrors = null;
12225
+ let errors = 0;
12226
+ const evaluated0 = validate58.evaluated;
12227
+ if (evaluated0.dynamicProps) {
12228
+ evaluated0.props = void 0;
12229
+ }
12230
+ if (evaluated0.dynamicItems) {
12231
+ evaluated0.items = void 0;
12232
+ }
12233
+ const _errs0 = errors;
12234
+ if (errors === _errs0) {
12235
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12236
+ let missing0;
12237
+ if (data.requestId === void 0 && (missing0 = "requestId") || data.name === void 0 && (missing0 = "name")) {
12238
+ validate58.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
12239
+ return false;
12240
+ } else {
12241
+ const _errs2 = errors;
12242
+ for (const key0 in data) {
12243
+ if (!(key0 === "requestId" || key0 === "name" || key0 === "expiresAt")) {
12244
+ validate58.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
12245
+ return false;
12246
+ break;
12247
+ }
12248
+ }
12249
+ if (_errs2 === errors) {
12250
+ if (data.requestId !== void 0) {
12251
+ let data0 = data.requestId;
12252
+ const _errs3 = errors;
12253
+ if (errors === _errs3) {
12254
+ if (typeof data0 === "string") {
12255
+ if (!pattern17.test(data0)) {
12256
+ validate58.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/requestId/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' }];
12257
+ return false;
12258
+ }
12259
+ } else {
12260
+ validate58.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12261
+ return false;
12262
+ }
12263
+ }
12264
+ var valid1 = _errs3 === errors;
12265
+ } else {
12266
+ var valid1 = true;
12267
+ }
12268
+ if (valid1) {
12269
+ if (data.name !== void 0) {
12270
+ let data1 = data.name;
12271
+ const _errs5 = errors;
12272
+ if (errors === _errs5) {
12273
+ if (typeof data1 === "string") {
12274
+ if (func1(data1) > 128) {
12275
+ validate58.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/name/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
12276
+ return false;
12277
+ } else {
12278
+ if (func1(data1) < 1) {
12279
+ validate58.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/name/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
12280
+ return false;
12281
+ } else {
12282
+ if (!pattern20.test(data1)) {
12283
+ validate58.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/name/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$" }, message: 'must match pattern "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$"' }];
12284
+ return false;
12285
+ }
12286
+ }
12287
+ }
12288
+ } else {
12289
+ validate58.errors = [{ instancePath: instancePath + "/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12290
+ return false;
12291
+ }
12292
+ }
12293
+ var valid1 = _errs5 === errors;
12294
+ } else {
12295
+ var valid1 = true;
12296
+ }
12297
+ if (valid1) {
12298
+ if (data.expiresAt !== void 0) {
12299
+ let data2 = data.expiresAt;
12300
+ const _errs7 = errors;
12301
+ if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2)) && isFinite(data2))) {
12302
+ validate58.errors = [{ instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/expiresAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
12303
+ return false;
12304
+ }
12305
+ if (errors === _errs7) {
12306
+ if (typeof data2 == "number" && isFinite(data2)) {
12307
+ if (data2 > 9007199254740991 || isNaN(data2)) {
12308
+ validate58.errors = [{ instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/expiresAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
12309
+ return false;
12310
+ } else {
12311
+ if (data2 < 0 || isNaN(data2)) {
12312
+ validate58.errors = [{ instancePath: instancePath + "/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/properties/expiresAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
12313
+ return false;
12314
+ }
12315
+ }
12316
+ }
12317
+ }
12318
+ var valid1 = _errs7 === errors;
12319
+ } else {
12320
+ var valid1 = true;
12321
+ }
12322
+ }
12323
+ }
12324
+ }
12325
+ }
12326
+ } else {
12327
+ validate58.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintRequest/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12328
+ return false;
12329
+ }
12330
+ }
12331
+ validate58.errors = vErrors;
12332
+ return errors === 0;
12333
+ }
12334
+ validate58.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12335
+ var pattern34 = new RegExp("^sk_[\\x21-\\x7e]+(?: [\\x21-\\x7e]+)*$", "u");
12336
+ function validate59(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12337
+ ;
12338
+ let vErrors = null;
12339
+ let errors = 0;
12340
+ const evaluated0 = validate59.evaluated;
12341
+ if (evaluated0.dynamicProps) {
12342
+ evaluated0.props = void 0;
12343
+ }
12344
+ if (evaluated0.dynamicItems) {
12345
+ evaluated0.items = void 0;
12346
+ }
12347
+ const _errs0 = errors;
12348
+ if (errors === _errs0) {
12349
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12350
+ let missing0;
12351
+ if (data.apiKey === void 0 && (missing0 = "apiKey") || data.secret === void 0 && (missing0 = "secret")) {
12352
+ validate59.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
12353
+ return false;
12354
+ } else {
12355
+ const _errs2 = errors;
12356
+ for (const key0 in data) {
12357
+ if (!(key0 === "apiKey" || key0 === "secret")) {
12358
+ validate59.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
12359
+ return false;
12360
+ break;
12361
+ }
12362
+ }
12363
+ if (_errs2 === errors) {
12364
+ if (data.apiKey !== void 0) {
12365
+ let data0 = data.apiKey;
12366
+ const _errs3 = errors;
12367
+ if (errors === _errs3) {
12368
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
12369
+ let missing1;
12370
+ if (data0.id === void 0 && (missing1 = "id") || data0.name === void 0 && (missing1 = "name") || data0.obfuscatedValue === void 0 && (missing1 = "obfuscatedValue") || data0.permissions === void 0 && (missing1 = "permissions") || data0.lastUsedAt === void 0 && (missing1 = "lastUsedAt") || data0.expiresAt === void 0 && (missing1 = "expiresAt") || data0.createdAt === void 0 && (missing1 = "createdAt") || data0.updatedAt === void 0 && (missing1 = "updatedAt")) {
12371
+ validate59.errors = [{ instancePath: instancePath + "/apiKey", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
12372
+ return false;
12373
+ } else {
12374
+ const _errs5 = errors;
12375
+ for (const key1 in data0) {
12376
+ if (!(key1 === "id" || key1 === "name" || key1 === "obfuscatedValue" || key1 === "permissions" || key1 === "lastUsedAt" || key1 === "expiresAt" || key1 === "createdAt" || key1 === "updatedAt")) {
12377
+ validate59.errors = [{ instancePath: instancePath + "/apiKey", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
12378
+ return false;
12379
+ break;
12380
+ }
12381
+ }
12382
+ if (_errs5 === errors) {
12383
+ if (data0.id !== void 0) {
12384
+ let data1 = data0.id;
12385
+ const _errs6 = errors;
12386
+ if (errors === _errs6) {
12387
+ if (typeof data1 === "string") {
12388
+ if (func1(data1) > 256) {
12389
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/id/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
12390
+ return false;
12391
+ } else {
12392
+ if (func1(data1) < 9) {
12393
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/id/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" }];
12394
+ return false;
12395
+ } else {
12396
+ if (!pattern18.test(data1)) {
12397
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/id/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' }];
12398
+ return false;
12399
+ }
12400
+ }
12401
+ }
12402
+ } else {
12403
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12404
+ return false;
12405
+ }
12406
+ }
12407
+ var valid2 = _errs6 === errors;
12408
+ } else {
12409
+ var valid2 = true;
12410
+ }
12411
+ if (valid2) {
12412
+ if (data0.name !== void 0) {
12413
+ let data2 = data0.name;
12414
+ const _errs8 = errors;
12415
+ if (errors === _errs8) {
12416
+ if (typeof data2 === "string") {
12417
+ if (func1(data2) > 128) {
12418
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/name/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
12419
+ return false;
12420
+ } else {
12421
+ if (func1(data2) < 1) {
12422
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/name/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
12423
+ return false;
12424
+ } else {
12425
+ if (!pattern20.test(data2)) {
12426
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/name/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$" }, message: 'must match pattern "^[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?$"' }];
12427
+ return false;
12428
+ }
12429
+ }
12430
+ }
12431
+ } else {
12432
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/name", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12433
+ return false;
12434
+ }
12435
+ }
12436
+ var valid2 = _errs8 === errors;
12437
+ } else {
12438
+ var valid2 = true;
12439
+ }
12440
+ if (valid2) {
12441
+ if (data0.obfuscatedValue !== void 0) {
12442
+ let data3 = data0.obfuscatedValue;
12443
+ const _errs10 = errors;
12444
+ if (errors === _errs10) {
12445
+ if (typeof data3 === "string") {
12446
+ if (func1(data3) > 256) {
12447
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/obfuscatedValue/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
12448
+ return false;
12449
+ } else {
12450
+ if (func1(data3) < 1) {
12451
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/obfuscatedValue/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
12452
+ return false;
12453
+ } else {
12454
+ if (!pattern21.test(data3)) {
12455
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/obfuscatedValue/pattern", keyword: "pattern", params: { pattern: "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$" }, message: 'must match pattern "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060\\u2066-\\u2069\\ufeff]+$"' }];
12456
+ return false;
12457
+ }
12458
+ }
12459
+ }
12460
+ } else {
12461
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/obfuscatedValue", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/obfuscatedValue/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12462
+ return false;
12463
+ }
12464
+ }
12465
+ var valid2 = _errs10 === errors;
12466
+ } else {
12467
+ var valid2 = true;
12468
+ }
12469
+ if (valid2) {
12470
+ if (data0.permissions !== void 0) {
12471
+ let data4 = data0.permissions;
12472
+ const _errs12 = errors;
12473
+ if (errors === _errs12) {
12474
+ if (Array.isArray(data4)) {
12475
+ if (data4.length > 100) {
12476
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
12477
+ return false;
12478
+ } else {
12479
+ var valid3 = true;
12480
+ const len0 = data4.length;
12481
+ for (let i0 = 0; i0 < len0; i0++) {
12482
+ let data5 = data4[i0];
12483
+ const _errs14 = errors;
12484
+ if (errors === _errs14) {
12485
+ if (typeof data5 === "string") {
12486
+ if (func1(data5) > 128) {
12487
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/items/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
12488
+ return false;
12489
+ } else {
12490
+ if (func1(data5) < 1) {
12491
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
12492
+ return false;
12493
+ } else {
12494
+ if (!pattern22.test(data5)) {
12495
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/items/pattern", keyword: "pattern", params: { pattern: "^[\\x21-\\x7e]+$" }, message: 'must match pattern "^[\\x21-\\x7e]+$"' }];
12496
+ return false;
12497
+ }
12498
+ }
12499
+ }
12500
+ } else {
12501
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12502
+ return false;
12503
+ }
12504
+ }
12505
+ var valid3 = _errs14 === errors;
12506
+ if (!valid3) {
12507
+ break;
12508
+ }
12509
+ }
12510
+ }
12511
+ } else {
12512
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/permissions", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/permissions/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
12513
+ return false;
12514
+ }
12515
+ }
12516
+ var valid2 = _errs12 === errors;
12517
+ } else {
12518
+ var valid2 = true;
12519
+ }
12520
+ if (valid2) {
12521
+ if (data0.lastUsedAt !== void 0) {
12522
+ let data6 = data0.lastUsedAt;
12523
+ const _errs16 = errors;
12524
+ const _errs17 = errors;
12525
+ let valid4 = false;
12526
+ const _errs18 = errors;
12527
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6)) && isFinite(data6))) {
12528
+ const err0 = { instancePath: instancePath + "/apiKey/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/lastUsedAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
12529
+ if (vErrors === null) {
12530
+ vErrors = [err0];
12531
+ } else {
12532
+ vErrors.push(err0);
12533
+ }
12534
+ errors++;
12535
+ }
12536
+ if (errors === _errs18) {
12537
+ if (typeof data6 == "number" && isFinite(data6)) {
12538
+ if (data6 > 9007199254740991 || isNaN(data6)) {
12539
+ const err1 = { instancePath: instancePath + "/apiKey/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/lastUsedAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
12540
+ if (vErrors === null) {
12541
+ vErrors = [err1];
12542
+ } else {
12543
+ vErrors.push(err1);
12544
+ }
12545
+ errors++;
12546
+ } else {
12547
+ if (data6 < 0 || isNaN(data6)) {
12548
+ const err2 = { instancePath: instancePath + "/apiKey/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/lastUsedAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
12549
+ if (vErrors === null) {
12550
+ vErrors = [err2];
12551
+ } else {
12552
+ vErrors.push(err2);
12553
+ }
12554
+ errors++;
12555
+ }
12556
+ }
12557
+ }
12558
+ }
12559
+ var _valid0 = _errs18 === errors;
12560
+ valid4 = valid4 || _valid0;
12561
+ const _errs20 = errors;
12562
+ if (data6 !== null) {
12563
+ const err3 = { instancePath: instancePath + "/apiKey/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/lastUsedAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
12564
+ if (vErrors === null) {
12565
+ vErrors = [err3];
12566
+ } else {
12567
+ vErrors.push(err3);
12568
+ }
12569
+ errors++;
12570
+ }
12571
+ var _valid0 = _errs20 === errors;
12572
+ valid4 = valid4 || _valid0;
12573
+ if (!valid4) {
12574
+ const err4 = { instancePath: instancePath + "/apiKey/lastUsedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/lastUsedAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
12575
+ if (vErrors === null) {
12576
+ vErrors = [err4];
12577
+ } else {
12578
+ vErrors.push(err4);
12579
+ }
12580
+ errors++;
12581
+ validate59.errors = vErrors;
12582
+ return false;
12583
+ } else {
12584
+ errors = _errs17;
12585
+ if (vErrors !== null) {
12586
+ if (_errs17) {
12587
+ vErrors.length = _errs17;
12588
+ } else {
12589
+ vErrors = null;
12590
+ }
12591
+ }
12592
+ }
12593
+ var valid2 = _errs16 === errors;
12594
+ } else {
12595
+ var valid2 = true;
12596
+ }
12597
+ if (valid2) {
12598
+ if (data0.expiresAt !== void 0) {
12599
+ let data7 = data0.expiresAt;
12600
+ const _errs22 = errors;
12601
+ const _errs23 = errors;
12602
+ let valid5 = false;
12603
+ const _errs24 = errors;
12604
+ if (!(typeof data7 == "number" && (!(data7 % 1) && !isNaN(data7)) && isFinite(data7))) {
12605
+ const err5 = { instancePath: instancePath + "/apiKey/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/expiresAt/anyOf/0/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
12606
+ if (vErrors === null) {
12607
+ vErrors = [err5];
12608
+ } else {
12609
+ vErrors.push(err5);
12610
+ }
12611
+ errors++;
12612
+ }
12613
+ if (errors === _errs24) {
12614
+ if (typeof data7 == "number" && isFinite(data7)) {
12615
+ if (data7 > 9007199254740991 || isNaN(data7)) {
12616
+ const err6 = { instancePath: instancePath + "/apiKey/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/expiresAt/anyOf/0/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
12617
+ if (vErrors === null) {
12618
+ vErrors = [err6];
12619
+ } else {
12620
+ vErrors.push(err6);
12621
+ }
12622
+ errors++;
12623
+ } else {
12624
+ if (data7 < 0 || isNaN(data7)) {
12625
+ const err7 = { instancePath: instancePath + "/apiKey/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/expiresAt/anyOf/0/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
12626
+ if (vErrors === null) {
12627
+ vErrors = [err7];
12628
+ } else {
12629
+ vErrors.push(err7);
12630
+ }
12631
+ errors++;
12632
+ }
12633
+ }
12634
+ }
12635
+ }
12636
+ var _valid1 = _errs24 === errors;
12637
+ valid5 = valid5 || _valid1;
12638
+ const _errs26 = errors;
12639
+ if (data7 !== null) {
12640
+ const err8 = { instancePath: instancePath + "/apiKey/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/expiresAt/anyOf/1/type", keyword: "type", params: { type: "null" }, message: "must be null" };
12641
+ if (vErrors === null) {
12642
+ vErrors = [err8];
12643
+ } else {
12644
+ vErrors.push(err8);
12645
+ }
12646
+ errors++;
12647
+ }
12648
+ var _valid1 = _errs26 === errors;
12649
+ valid5 = valid5 || _valid1;
12650
+ if (!valid5) {
12651
+ const err9 = { instancePath: instancePath + "/apiKey/expiresAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/expiresAt/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
12652
+ if (vErrors === null) {
12653
+ vErrors = [err9];
12654
+ } else {
12655
+ vErrors.push(err9);
12656
+ }
12657
+ errors++;
12658
+ validate59.errors = vErrors;
12659
+ return false;
12660
+ } else {
12661
+ errors = _errs23;
12662
+ if (vErrors !== null) {
12663
+ if (_errs23) {
12664
+ vErrors.length = _errs23;
12665
+ } else {
12666
+ vErrors = null;
12667
+ }
12668
+ }
12669
+ }
12670
+ var valid2 = _errs22 === errors;
12671
+ } else {
12672
+ var valid2 = true;
12673
+ }
12674
+ if (valid2) {
12675
+ if (data0.createdAt !== void 0) {
12676
+ let data8 = data0.createdAt;
12677
+ const _errs28 = errors;
12678
+ if (!(typeof data8 == "number" && (!(data8 % 1) && !isNaN(data8)) && isFinite(data8))) {
12679
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/createdAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
12680
+ return false;
12681
+ }
12682
+ if (errors === _errs28) {
12683
+ if (typeof data8 == "number" && isFinite(data8)) {
12684
+ if (data8 > 9007199254740991 || isNaN(data8)) {
12685
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/createdAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
12686
+ return false;
12687
+ } else {
12688
+ if (data8 < 0 || isNaN(data8)) {
12689
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/createdAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/createdAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
12690
+ return false;
12691
+ }
12692
+ }
12693
+ }
12694
+ }
12695
+ var valid2 = _errs28 === errors;
12696
+ } else {
12697
+ var valid2 = true;
12698
+ }
12699
+ if (valid2) {
12700
+ if (data0.updatedAt !== void 0) {
12701
+ let data9 = data0.updatedAt;
12702
+ const _errs30 = errors;
12703
+ if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
12704
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/updatedAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
12705
+ return false;
12706
+ }
12707
+ if (errors === _errs30) {
12708
+ if (typeof data9 == "number" && isFinite(data9)) {
12709
+ if (data9 > 9007199254740991 || isNaN(data9)) {
12710
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/updatedAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
12711
+ return false;
12712
+ } else {
12713
+ if (data9 < 0 || isNaN(data9)) {
12714
+ validate59.errors = [{ instancePath: instancePath + "/apiKey/updatedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/properties/updatedAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
12715
+ return false;
12716
+ }
12717
+ }
12718
+ }
12719
+ }
12720
+ var valid2 = _errs30 === errors;
12721
+ } else {
12722
+ var valid2 = true;
12723
+ }
12724
+ }
12725
+ }
12726
+ }
12727
+ }
12728
+ }
12729
+ }
12730
+ }
12731
+ }
12732
+ }
12733
+ } else {
12734
+ validate59.errors = [{ instancePath: instancePath + "/apiKey", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/apiKey/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12735
+ return false;
12736
+ }
12737
+ }
12738
+ var valid1 = _errs3 === errors;
12739
+ } else {
12740
+ var valid1 = true;
12741
+ }
12742
+ if (valid1) {
12743
+ if (data.secret !== void 0) {
12744
+ let data10 = data.secret;
12745
+ const _errs32 = errors;
12746
+ if (errors === _errs32) {
12747
+ if (typeof data10 === "string") {
12748
+ if (func1(data10) > 4096) {
12749
+ validate59.errors = [{ instancePath: instancePath + "/secret", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/secret/maxLength", keyword: "maxLength", params: { limit: 4096 }, message: "must NOT have more than 4096 characters" }];
12750
+ return false;
12751
+ } else {
12752
+ if (func1(data10) < 4) {
12753
+ validate59.errors = [{ instancePath: instancePath + "/secret", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/secret/minLength", keyword: "minLength", params: { limit: 4 }, message: "must NOT have fewer than 4 characters" }];
12754
+ return false;
12755
+ } else {
12756
+ if (!pattern34.test(data10)) {
12757
+ validate59.errors = [{ instancePath: instancePath + "/secret", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/secret/pattern", keyword: "pattern", params: { pattern: "^sk_[\\x21-\\x7e]+(?: [\\x21-\\x7e]+)*$" }, message: 'must match pattern "^sk_[\\x21-\\x7e]+(?: [\\x21-\\x7e]+)*$"' }];
12758
+ return false;
12759
+ }
12760
+ }
12761
+ }
12762
+ } else {
12763
+ validate59.errors = [{ instancePath: instancePath + "/secret", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/properties/secret/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12764
+ return false;
12765
+ }
12766
+ }
12767
+ var valid1 = _errs32 === errors;
12768
+ } else {
12769
+ var valid1 = true;
12770
+ }
12771
+ }
12772
+ }
12773
+ }
12774
+ } else {
12775
+ validate59.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyMintResponse/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12776
+ return false;
12777
+ }
12778
+ }
12779
+ validate59.errors = vErrors;
12780
+ return errors === 0;
12781
+ }
12782
+ validate59.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12783
+ function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12784
+ ;
12785
+ let vErrors = null;
12786
+ let errors = 0;
12787
+ const evaluated0 = validate60.evaluated;
12788
+ if (evaluated0.dynamicProps) {
12789
+ evaluated0.props = void 0;
12790
+ }
12791
+ if (evaluated0.dynamicItems) {
12792
+ evaluated0.items = void 0;
12793
+ }
12794
+ const _errs0 = errors;
12795
+ if (errors === _errs0) {
12796
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12797
+ let missing0;
12798
+ if (data.requestId === void 0 && (missing0 = "requestId")) {
12799
+ validate60.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeRequest/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
12800
+ return false;
12801
+ } else {
12802
+ const _errs2 = errors;
12803
+ for (const key0 in data) {
12804
+ if (!(key0 === "requestId")) {
12805
+ validate60.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeRequest/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
12806
+ return false;
12807
+ break;
12808
+ }
12809
+ }
12810
+ if (_errs2 === errors) {
12811
+ if (data.requestId !== void 0) {
12812
+ let data0 = data.requestId;
12813
+ const _errs3 = errors;
12814
+ if (errors === _errs3) {
12815
+ if (typeof data0 === "string") {
12816
+ if (!pattern17.test(data0)) {
12817
+ validate60.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeRequest/properties/requestId/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' }];
12818
+ return false;
12819
+ }
12820
+ } else {
12821
+ validate60.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeRequest/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12822
+ return false;
12823
+ }
12824
+ }
12825
+ }
12826
+ }
12827
+ }
12828
+ } else {
12829
+ validate60.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeRequest/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12830
+ return false;
12831
+ }
12832
+ }
12833
+ validate60.errors = vErrors;
12834
+ return errors === 0;
12835
+ }
12836
+ validate60.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12837
+ function validate61(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12838
+ ;
12839
+ let vErrors = null;
12840
+ let errors = 0;
12841
+ const evaluated0 = validate61.evaluated;
12842
+ if (evaluated0.dynamicProps) {
12843
+ evaluated0.props = void 0;
12844
+ }
12845
+ if (evaluated0.dynamicItems) {
12846
+ evaluated0.items = void 0;
12847
+ }
12848
+ const _errs0 = errors;
12849
+ if (errors === _errs0) {
12850
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12851
+ let missing0;
12852
+ if (data.apiKeyId === void 0 && (missing0 = "apiKeyId") || data.revoked === void 0 && (missing0 = "revoked")) {
12853
+ validate61.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
12854
+ return false;
12855
+ } else {
12856
+ const _errs2 = errors;
12857
+ for (const key0 in data) {
12858
+ if (!(key0 === "apiKeyId" || key0 === "revoked")) {
12859
+ validate61.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
12860
+ return false;
12861
+ break;
12862
+ }
12863
+ }
12864
+ if (_errs2 === errors) {
12865
+ if (data.apiKeyId !== void 0) {
12866
+ let data0 = data.apiKeyId;
12867
+ const _errs3 = errors;
12868
+ if (errors === _errs3) {
12869
+ if (typeof data0 === "string") {
12870
+ if (func1(data0) > 256) {
12871
+ validate61.errors = [{ instancePath: instancePath + "/apiKeyId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/apiKeyId/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
12872
+ return false;
12873
+ } else {
12874
+ if (func1(data0) < 9) {
12875
+ validate61.errors = [{ instancePath: instancePath + "/apiKeyId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/apiKeyId/minLength", keyword: "minLength", params: { limit: 9 }, message: "must NOT have fewer than 9 characters" }];
12876
+ return false;
12877
+ } else {
12878
+ if (!pattern18.test(data0)) {
12879
+ validate61.errors = [{ instancePath: instancePath + "/apiKeyId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/apiKeyId/pattern", keyword: "pattern", params: { pattern: "^api_key_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^api_key_[A-Za-z0-9_-]+$"' }];
12880
+ return false;
12881
+ }
12882
+ }
12883
+ }
12884
+ } else {
12885
+ validate61.errors = [{ instancePath: instancePath + "/apiKeyId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/apiKeyId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12886
+ return false;
12887
+ }
12888
+ }
12889
+ var valid1 = _errs3 === errors;
12890
+ } else {
12891
+ var valid1 = true;
12892
+ }
12893
+ if (valid1) {
12894
+ if (data.revoked !== void 0) {
12895
+ let data1 = data.revoked;
12896
+ const _errs5 = errors;
12897
+ if (typeof data1 !== "boolean") {
12898
+ validate61.errors = [{ instancePath: instancePath + "/revoked", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/revoked/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
12899
+ return false;
12900
+ }
12901
+ if (true !== data1) {
12902
+ validate61.errors = [{ instancePath: instancePath + "/revoked", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/properties/revoked/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" }];
12903
+ return false;
12904
+ }
12905
+ var valid1 = _errs5 === errors;
12906
+ } else {
12907
+ var valid1 = true;
12908
+ }
12909
+ }
12910
+ }
12911
+ }
12912
+ } else {
12913
+ validate61.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/UserApiKeyRevokeResponse/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12914
+ return false;
12915
+ }
12916
+ }
12917
+ validate61.errors = vErrors;
12918
+ return errors === 0;
12919
+ }
12920
+ validate61.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
10945
12921
 
10946
12922
  // src/protocol/decision-lifecycle.ts
10947
12923
  var DECISION_LIFECYCLE_PROTOCOL_VERSION = 2;