@primitive.ai/prim 0.1.0-alpha.84 → 0.1.0-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon/server.js +411 -0
- package/dist/hook-runtime/daemon/server.js +411 -0
- package/dist/hook-runtime/index.js +468 -0
- package/dist/index.js +468 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11850,6 +11850,417 @@ function validate61(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
11850
11850
|
return errors === 0;
|
|
11851
11851
|
}
|
|
11852
11852
|
validate61.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
11853
|
+
function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
11854
|
+
;
|
|
11855
|
+
let vErrors = null;
|
|
11856
|
+
let errors = 0;
|
|
11857
|
+
const evaluated0 = validate62.evaluated;
|
|
11858
|
+
if (evaluated0.dynamicProps) {
|
|
11859
|
+
evaluated0.props = void 0;
|
|
11860
|
+
}
|
|
11861
|
+
if (evaluated0.dynamicItems) {
|
|
11862
|
+
evaluated0.items = void 0;
|
|
11863
|
+
}
|
|
11864
|
+
const _errs0 = errors;
|
|
11865
|
+
if (errors === _errs0) {
|
|
11866
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
11867
|
+
let missing0;
|
|
11868
|
+
if (data.error === void 0 && (missing0 = "error")) {
|
|
11869
|
+
validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
11870
|
+
return false;
|
|
11871
|
+
} else {
|
|
11872
|
+
const _errs2 = errors;
|
|
11873
|
+
for (const key0 in data) {
|
|
11874
|
+
if (!(key0 === "error")) {
|
|
11875
|
+
validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
11876
|
+
return false;
|
|
11877
|
+
break;
|
|
11878
|
+
}
|
|
11879
|
+
}
|
|
11880
|
+
if (_errs2 === errors) {
|
|
11881
|
+
if (data.error !== void 0) {
|
|
11882
|
+
let data0 = data.error;
|
|
11883
|
+
if (typeof data0 !== "string") {
|
|
11884
|
+
validate62.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
11885
|
+
return false;
|
|
11886
|
+
}
|
|
11887
|
+
if ("Not found" !== data0) {
|
|
11888
|
+
validate62.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/properties/error/const", keyword: "const", params: { allowedValue: "Not found" }, message: "must be equal to constant" }];
|
|
11889
|
+
return false;
|
|
11890
|
+
}
|
|
11891
|
+
}
|
|
11892
|
+
}
|
|
11893
|
+
}
|
|
11894
|
+
} else {
|
|
11895
|
+
validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
11896
|
+
return false;
|
|
11897
|
+
}
|
|
11898
|
+
}
|
|
11899
|
+
validate62.errors = vErrors;
|
|
11900
|
+
return errors === 0;
|
|
11901
|
+
}
|
|
11902
|
+
validate62.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
11903
|
+
function validate63(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
11904
|
+
;
|
|
11905
|
+
let vErrors = null;
|
|
11906
|
+
let errors = 0;
|
|
11907
|
+
const evaluated0 = validate63.evaluated;
|
|
11908
|
+
if (evaluated0.dynamicProps) {
|
|
11909
|
+
evaluated0.props = void 0;
|
|
11910
|
+
}
|
|
11911
|
+
if (evaluated0.dynamicItems) {
|
|
11912
|
+
evaluated0.items = void 0;
|
|
11913
|
+
}
|
|
11914
|
+
const _errs1 = errors;
|
|
11915
|
+
let valid1 = false;
|
|
11916
|
+
const _errs2 = errors;
|
|
11917
|
+
if (errors === _errs2) {
|
|
11918
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
11919
|
+
let missing0;
|
|
11920
|
+
if (data.error === void 0 && (missing0 = "error")) {
|
|
11921
|
+
const err0 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" };
|
|
11922
|
+
if (vErrors === null) {
|
|
11923
|
+
vErrors = [err0];
|
|
11924
|
+
} else {
|
|
11925
|
+
vErrors.push(err0);
|
|
11926
|
+
}
|
|
11927
|
+
errors++;
|
|
11928
|
+
} else {
|
|
11929
|
+
const _errs4 = errors;
|
|
11930
|
+
for (const key0 in data) {
|
|
11931
|
+
if (!(key0 === "error")) {
|
|
11932
|
+
const err1 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
11933
|
+
if (vErrors === null) {
|
|
11934
|
+
vErrors = [err1];
|
|
11935
|
+
} else {
|
|
11936
|
+
vErrors.push(err1);
|
|
11937
|
+
}
|
|
11938
|
+
errors++;
|
|
11939
|
+
break;
|
|
11940
|
+
}
|
|
11941
|
+
}
|
|
11942
|
+
if (_errs4 === errors) {
|
|
11943
|
+
if (data.error !== void 0) {
|
|
11944
|
+
let data0 = data.error;
|
|
11945
|
+
if (typeof data0 !== "string") {
|
|
11946
|
+
const err2 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
11947
|
+
if (vErrors === null) {
|
|
11948
|
+
vErrors = [err2];
|
|
11949
|
+
} else {
|
|
11950
|
+
vErrors.push(err2);
|
|
11951
|
+
}
|
|
11952
|
+
errors++;
|
|
11953
|
+
}
|
|
11954
|
+
if ("Not found" !== data0) {
|
|
11955
|
+
const err3 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/properties/error/const", keyword: "const", params: { allowedValue: "Not found" }, message: "must be equal to constant" };
|
|
11956
|
+
if (vErrors === null) {
|
|
11957
|
+
vErrors = [err3];
|
|
11958
|
+
} else {
|
|
11959
|
+
vErrors.push(err3);
|
|
11960
|
+
}
|
|
11961
|
+
errors++;
|
|
11962
|
+
}
|
|
11963
|
+
}
|
|
11964
|
+
}
|
|
11965
|
+
}
|
|
11966
|
+
} else {
|
|
11967
|
+
const err4 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
11968
|
+
if (vErrors === null) {
|
|
11969
|
+
vErrors = [err4];
|
|
11970
|
+
} else {
|
|
11971
|
+
vErrors.push(err4);
|
|
11972
|
+
}
|
|
11973
|
+
errors++;
|
|
11974
|
+
}
|
|
11975
|
+
}
|
|
11976
|
+
var _valid0 = _errs2 === errors;
|
|
11977
|
+
valid1 = valid1 || _valid0;
|
|
11978
|
+
if (_valid0) {
|
|
11979
|
+
var props0 = true;
|
|
11980
|
+
}
|
|
11981
|
+
const _errs7 = errors;
|
|
11982
|
+
if (errors === _errs7) {
|
|
11983
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
11984
|
+
let missing1;
|
|
11985
|
+
if (data.error === void 0 && (missing1 = "error")) {
|
|
11986
|
+
const err5 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
|
|
11987
|
+
if (vErrors === null) {
|
|
11988
|
+
vErrors = [err5];
|
|
11989
|
+
} else {
|
|
11990
|
+
vErrors.push(err5);
|
|
11991
|
+
}
|
|
11992
|
+
errors++;
|
|
11993
|
+
} else {
|
|
11994
|
+
const _errs9 = errors;
|
|
11995
|
+
for (const key1 in data) {
|
|
11996
|
+
if (!(key1 === "error")) {
|
|
11997
|
+
const err6 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
|
|
11998
|
+
if (vErrors === null) {
|
|
11999
|
+
vErrors = [err6];
|
|
12000
|
+
} else {
|
|
12001
|
+
vErrors.push(err6);
|
|
12002
|
+
}
|
|
12003
|
+
errors++;
|
|
12004
|
+
break;
|
|
12005
|
+
}
|
|
12006
|
+
}
|
|
12007
|
+
if (_errs9 === errors) {
|
|
12008
|
+
if (data.error !== void 0) {
|
|
12009
|
+
let data1 = data.error;
|
|
12010
|
+
if (typeof data1 !== "string") {
|
|
12011
|
+
const err7 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
12012
|
+
if (vErrors === null) {
|
|
12013
|
+
vErrors = [err7];
|
|
12014
|
+
} else {
|
|
12015
|
+
vErrors.push(err7);
|
|
12016
|
+
}
|
|
12017
|
+
errors++;
|
|
12018
|
+
}
|
|
12019
|
+
if ("connect_device_auth_unavailable" !== data1) {
|
|
12020
|
+
const err8 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/properties/error/const", keyword: "const", params: { allowedValue: "connect_device_auth_unavailable" }, message: "must be equal to constant" };
|
|
12021
|
+
if (vErrors === null) {
|
|
12022
|
+
vErrors = [err8];
|
|
12023
|
+
} else {
|
|
12024
|
+
vErrors.push(err8);
|
|
12025
|
+
}
|
|
12026
|
+
errors++;
|
|
12027
|
+
}
|
|
12028
|
+
}
|
|
12029
|
+
}
|
|
12030
|
+
}
|
|
12031
|
+
} else {
|
|
12032
|
+
const err9 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
12033
|
+
if (vErrors === null) {
|
|
12034
|
+
vErrors = [err9];
|
|
12035
|
+
} else {
|
|
12036
|
+
vErrors.push(err9);
|
|
12037
|
+
}
|
|
12038
|
+
errors++;
|
|
12039
|
+
}
|
|
12040
|
+
}
|
|
12041
|
+
var _valid0 = _errs7 === errors;
|
|
12042
|
+
valid1 = valid1 || _valid0;
|
|
12043
|
+
if (_valid0) {
|
|
12044
|
+
if (props0 !== true) {
|
|
12045
|
+
props0 = true;
|
|
12046
|
+
}
|
|
12047
|
+
}
|
|
12048
|
+
if (!valid1) {
|
|
12049
|
+
const err10 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
12050
|
+
if (vErrors === null) {
|
|
12051
|
+
vErrors = [err10];
|
|
12052
|
+
} else {
|
|
12053
|
+
vErrors.push(err10);
|
|
12054
|
+
}
|
|
12055
|
+
errors++;
|
|
12056
|
+
validate63.errors = vErrors;
|
|
12057
|
+
return false;
|
|
12058
|
+
} else {
|
|
12059
|
+
errors = _errs1;
|
|
12060
|
+
if (vErrors !== null) {
|
|
12061
|
+
if (_errs1) {
|
|
12062
|
+
vErrors.length = _errs1;
|
|
12063
|
+
} else {
|
|
12064
|
+
vErrors = null;
|
|
12065
|
+
}
|
|
12066
|
+
}
|
|
12067
|
+
}
|
|
12068
|
+
validate63.errors = vErrors;
|
|
12069
|
+
evaluated0.props = props0;
|
|
12070
|
+
return errors === 0;
|
|
12071
|
+
}
|
|
12072
|
+
validate63.evaluated = { "dynamicProps": true, "dynamicItems": false };
|
|
12073
|
+
var schema119 = { "type": "object", "properties": { "protocol_version": { "type": "number", "const": 1 }, "issuer": { "type": "string", "format": "uri" }, "client_id": { "type": "string", "maxLength": 256, "pattern": "^client_[A-Za-z0-9_-]+$" }, "default_scopes": { "minItems": 4, "maxItems": 4, "type": "array", "items": { "type": "string", "enum": ["openid", "profile", "email", "offline_access"] } } }, "required": ["protocol_version", "issuer", "client_id", "default_scopes"], "additionalProperties": false, "x-primitive-runtime-refinements": ["canonical_https_origin", "exact_workos_connect_device_scopes"] };
|
|
12074
|
+
var pattern37 = new RegExp("^client_[A-Za-z0-9_-]+$", "u");
|
|
12075
|
+
function validate64(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
12076
|
+
;
|
|
12077
|
+
let vErrors = null;
|
|
12078
|
+
let errors = 0;
|
|
12079
|
+
const evaluated0 = validate64.evaluated;
|
|
12080
|
+
if (evaluated0.dynamicProps) {
|
|
12081
|
+
evaluated0.props = void 0;
|
|
12082
|
+
}
|
|
12083
|
+
if (evaluated0.dynamicItems) {
|
|
12084
|
+
evaluated0.items = void 0;
|
|
12085
|
+
}
|
|
12086
|
+
const _errs0 = errors;
|
|
12087
|
+
if (errors === _errs0) {
|
|
12088
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
12089
|
+
let missing0;
|
|
12090
|
+
if (data.protocol_version === void 0 && (missing0 = "protocol_version") || data.issuer === void 0 && (missing0 = "issuer") || data.client_id === void 0 && (missing0 = "client_id") || data.default_scopes === void 0 && (missing0 = "default_scopes")) {
|
|
12091
|
+
validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
12092
|
+
return false;
|
|
12093
|
+
} else {
|
|
12094
|
+
const _errs3 = errors;
|
|
12095
|
+
for (const key0 in data) {
|
|
12096
|
+
if (!(key0 === "protocol_version" || key0 === "issuer" || key0 === "client_id" || key0 === "default_scopes")) {
|
|
12097
|
+
validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
12098
|
+
return false;
|
|
12099
|
+
break;
|
|
12100
|
+
}
|
|
12101
|
+
}
|
|
12102
|
+
if (_errs3 === errors) {
|
|
12103
|
+
if (data.protocol_version !== void 0) {
|
|
12104
|
+
let data0 = data.protocol_version;
|
|
12105
|
+
const _errs4 = errors;
|
|
12106
|
+
if (!(typeof data0 == "number" && isFinite(data0))) {
|
|
12107
|
+
validate64.errors = [{ instancePath: instancePath + "/protocol_version", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/protocol_version/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
|
|
12108
|
+
return false;
|
|
12109
|
+
}
|
|
12110
|
+
if (1 !== data0) {
|
|
12111
|
+
validate64.errors = [{ instancePath: instancePath + "/protocol_version", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/protocol_version/const", keyword: "const", params: { allowedValue: 1 }, message: "must be equal to constant" }];
|
|
12112
|
+
return false;
|
|
12113
|
+
}
|
|
12114
|
+
var valid1 = _errs4 === errors;
|
|
12115
|
+
} else {
|
|
12116
|
+
var valid1 = true;
|
|
12117
|
+
}
|
|
12118
|
+
if (valid1) {
|
|
12119
|
+
if (data.issuer !== void 0) {
|
|
12120
|
+
const _errs6 = errors;
|
|
12121
|
+
if (errors === _errs6) {
|
|
12122
|
+
if (errors === _errs6) {
|
|
12123
|
+
if (!(typeof data.issuer === "string")) {
|
|
12124
|
+
validate64.errors = [{ instancePath: instancePath + "/issuer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/issuer/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
12125
|
+
return false;
|
|
12126
|
+
}
|
|
12127
|
+
}
|
|
12128
|
+
}
|
|
12129
|
+
var valid1 = _errs6 === errors;
|
|
12130
|
+
} else {
|
|
12131
|
+
var valid1 = true;
|
|
12132
|
+
}
|
|
12133
|
+
if (valid1) {
|
|
12134
|
+
if (data.client_id !== void 0) {
|
|
12135
|
+
let data2 = data.client_id;
|
|
12136
|
+
const _errs8 = errors;
|
|
12137
|
+
if (errors === _errs8) {
|
|
12138
|
+
if (typeof data2 === "string") {
|
|
12139
|
+
if (func1(data2) > 256) {
|
|
12140
|
+
validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
|
|
12141
|
+
return false;
|
|
12142
|
+
} else {
|
|
12143
|
+
if (!pattern37.test(data2)) {
|
|
12144
|
+
validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/pattern", keyword: "pattern", params: { pattern: "^client_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^client_[A-Za-z0-9_-]+$"' }];
|
|
12145
|
+
return false;
|
|
12146
|
+
}
|
|
12147
|
+
}
|
|
12148
|
+
} else {
|
|
12149
|
+
validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
12150
|
+
return false;
|
|
12151
|
+
}
|
|
12152
|
+
}
|
|
12153
|
+
var valid1 = _errs8 === errors;
|
|
12154
|
+
} else {
|
|
12155
|
+
var valid1 = true;
|
|
12156
|
+
}
|
|
12157
|
+
if (valid1) {
|
|
12158
|
+
if (data.default_scopes !== void 0) {
|
|
12159
|
+
let data3 = data.default_scopes;
|
|
12160
|
+
const _errs10 = errors;
|
|
12161
|
+
if (errors === _errs10) {
|
|
12162
|
+
if (Array.isArray(data3)) {
|
|
12163
|
+
if (data3.length > 4) {
|
|
12164
|
+
validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/maxItems", keyword: "maxItems", params: { limit: 4 }, message: "must NOT have more than 4 items" }];
|
|
12165
|
+
return false;
|
|
12166
|
+
} else {
|
|
12167
|
+
if (data3.length < 4) {
|
|
12168
|
+
validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/minItems", keyword: "minItems", params: { limit: 4 }, message: "must NOT have fewer than 4 items" }];
|
|
12169
|
+
return false;
|
|
12170
|
+
} else {
|
|
12171
|
+
var valid2 = true;
|
|
12172
|
+
const len0 = data3.length;
|
|
12173
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
12174
|
+
let data4 = data3[i0];
|
|
12175
|
+
const _errs12 = errors;
|
|
12176
|
+
if (typeof data4 !== "string") {
|
|
12177
|
+
validate64.errors = [{ instancePath: instancePath + "/default_scopes/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
12178
|
+
return false;
|
|
12179
|
+
}
|
|
12180
|
+
if (!(data4 === "openid" || data4 === "profile" || data4 === "email" || data4 === "offline_access")) {
|
|
12181
|
+
validate64.errors = [{ instancePath: instancePath + "/default_scopes/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/items/enum", keyword: "enum", params: { allowedValues: schema119.properties.default_scopes.items.enum }, message: "must be equal to one of the allowed values" }];
|
|
12182
|
+
return false;
|
|
12183
|
+
}
|
|
12184
|
+
var valid2 = _errs12 === errors;
|
|
12185
|
+
if (!valid2) {
|
|
12186
|
+
break;
|
|
12187
|
+
}
|
|
12188
|
+
}
|
|
12189
|
+
}
|
|
12190
|
+
}
|
|
12191
|
+
} else {
|
|
12192
|
+
validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
12193
|
+
return false;
|
|
12194
|
+
}
|
|
12195
|
+
}
|
|
12196
|
+
var valid1 = _errs10 === errors;
|
|
12197
|
+
} else {
|
|
12198
|
+
var valid1 = true;
|
|
12199
|
+
}
|
|
12200
|
+
}
|
|
12201
|
+
}
|
|
12202
|
+
}
|
|
12203
|
+
}
|
|
12204
|
+
}
|
|
12205
|
+
} else {
|
|
12206
|
+
validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
12207
|
+
return false;
|
|
12208
|
+
}
|
|
12209
|
+
}
|
|
12210
|
+
validate64.errors = vErrors;
|
|
12211
|
+
return errors === 0;
|
|
12212
|
+
}
|
|
12213
|
+
validate64.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
12214
|
+
function validate65(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
12215
|
+
;
|
|
12216
|
+
let vErrors = null;
|
|
12217
|
+
let errors = 0;
|
|
12218
|
+
const evaluated0 = validate65.evaluated;
|
|
12219
|
+
if (evaluated0.dynamicProps) {
|
|
12220
|
+
evaluated0.props = void 0;
|
|
12221
|
+
}
|
|
12222
|
+
if (evaluated0.dynamicItems) {
|
|
12223
|
+
evaluated0.items = void 0;
|
|
12224
|
+
}
|
|
12225
|
+
const _errs0 = errors;
|
|
12226
|
+
if (errors === _errs0) {
|
|
12227
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
12228
|
+
let missing0;
|
|
12229
|
+
if (data.error === void 0 && (missing0 = "error")) {
|
|
12230
|
+
validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
12231
|
+
return false;
|
|
12232
|
+
} else {
|
|
12233
|
+
const _errs2 = errors;
|
|
12234
|
+
for (const key0 in data) {
|
|
12235
|
+
if (!(key0 === "error")) {
|
|
12236
|
+
validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
12237
|
+
return false;
|
|
12238
|
+
break;
|
|
12239
|
+
}
|
|
12240
|
+
}
|
|
12241
|
+
if (_errs2 === errors) {
|
|
12242
|
+
if (data.error !== void 0) {
|
|
12243
|
+
let data0 = data.error;
|
|
12244
|
+
if (typeof data0 !== "string") {
|
|
12245
|
+
validate65.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
12246
|
+
return false;
|
|
12247
|
+
}
|
|
12248
|
+
if ("connect_device_auth_unavailable" !== data0) {
|
|
12249
|
+
validate65.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/properties/error/const", keyword: "const", params: { allowedValue: "connect_device_auth_unavailable" }, message: "must be equal to constant" }];
|
|
12250
|
+
return false;
|
|
12251
|
+
}
|
|
12252
|
+
}
|
|
12253
|
+
}
|
|
12254
|
+
}
|
|
12255
|
+
} else {
|
|
12256
|
+
validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
12257
|
+
return false;
|
|
12258
|
+
}
|
|
12259
|
+
}
|
|
12260
|
+
validate65.errors = vErrors;
|
|
12261
|
+
return errors === 0;
|
|
12262
|
+
}
|
|
12263
|
+
validate65.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
11853
12264
|
|
|
11854
12265
|
// src/contract/cli-http-v1.ts
|
|
11855
12266
|
function isGitHubInstallIntentStatusResponse(value) {
|
|
@@ -17143,18 +17554,29 @@ var EXPECTED_STAGE = {
|
|
|
17143
17554
|
publish: "provisional",
|
|
17144
17555
|
restore: "draft",
|
|
17145
17556
|
ratify: "adopted",
|
|
17557
|
+
promote: "adopted",
|
|
17558
|
+
demote: "provisional",
|
|
17559
|
+
withdraw: "abandoned",
|
|
17146
17560
|
supersede: "superseded"
|
|
17147
17561
|
};
|
|
17148
17562
|
var PATH = {
|
|
17149
17563
|
publish: "/api/cli/decisions/publish",
|
|
17150
17564
|
restore: "/api/cli/decisions/restore",
|
|
17151
17565
|
ratify: "/api/cli/decisions/ratify",
|
|
17566
|
+
// `promote` is the human-facing alias for the established ratify wire
|
|
17567
|
+
// operation; no second server transition or contract endpoint exists.
|
|
17568
|
+
promote: "/api/cli/decisions/ratify",
|
|
17569
|
+
demote: "/api/cli/decisions/demote",
|
|
17570
|
+
withdraw: "/api/cli/decisions/withdraw",
|
|
17152
17571
|
supersede: "/api/cli/decisions/supersede"
|
|
17153
17572
|
};
|
|
17154
17573
|
var PAST_PARTICIPLE = {
|
|
17155
17574
|
publish: "published",
|
|
17156
17575
|
restore: "restored",
|
|
17157
17576
|
ratify: "ratified",
|
|
17577
|
+
promote: "promoted",
|
|
17578
|
+
demote: "demoted",
|
|
17579
|
+
withdraw: "withdrawn",
|
|
17158
17580
|
supersede: "superseded"
|
|
17159
17581
|
};
|
|
17160
17582
|
var ORG_UNBOUND_MESSAGE = "CLI token is not bound to an organization";
|
|
@@ -17164,6 +17586,8 @@ var DECISION_NOT_FOUND_MESSAGE = "Decision not found";
|
|
|
17164
17586
|
var REPLACEMENT_NOT_FOUND_MESSAGE = "Replacement decision not found";
|
|
17165
17587
|
var SELF_REPLACEMENT_MESSAGE = "A decision cannot supersede itself";
|
|
17166
17588
|
var OLD_SERVER_NOT_FOUND_MESSAGE = "Not found";
|
|
17589
|
+
var FEATURE_DISABLED_MESSAGE = "feature_disabled";
|
|
17590
|
+
var FEATURE_CHECK_UNAVAILABLE_MESSAGE = "feature_check_unavailable";
|
|
17167
17591
|
var STAGE_NAME = "(?:draft|provisional|adopted|superseded|abandoned)";
|
|
17168
17592
|
var IMMUTABLE_MESSAGE = new RegExp(
|
|
17169
17593
|
`^An ${STAGE_NAME} decision is immutable \u2014 supersede it to change it$`,
|
|
@@ -17208,6 +17632,15 @@ function formatSuccessHuman(operation, request, response) {
|
|
|
17208
17632
|
if (operation === "ratify") {
|
|
17209
17633
|
return `[prim] ${identifier} ratified as ${response.stage}.`;
|
|
17210
17634
|
}
|
|
17635
|
+
if (operation === "promote") {
|
|
17636
|
+
return `[prim] ${identifier} promoted as ${response.stage}.`;
|
|
17637
|
+
}
|
|
17638
|
+
if (operation === "demote") {
|
|
17639
|
+
return `[prim] ${identifier} demoted to provisional \u2014 advisory again until re-ratified.`;
|
|
17640
|
+
}
|
|
17641
|
+
if (operation === "withdraw") {
|
|
17642
|
+
return `[prim] ${identifier} withdrawn as abandoned \u2014 removed from active guidance, not deleted; recover with \`prim decisions restore\`.`;
|
|
17643
|
+
}
|
|
17211
17644
|
const replacement = safeRequestedIdentifier(
|
|
17212
17645
|
request.by,
|
|
17213
17646
|
"the replacement Decision"
|
|
@@ -17231,6 +17664,12 @@ function classifyHttpError2(error) {
|
|
|
17231
17664
|
if (error.status === 403 && message === NOT_AUTHOR_MESSAGE) {
|
|
17232
17665
|
return failure2("not_author", DECISION_LIFECYCLE_EXIT.rejected, error.status);
|
|
17233
17666
|
}
|
|
17667
|
+
if (error.status === 403 && message === FEATURE_DISABLED_MESSAGE) {
|
|
17668
|
+
return failure2("feature_disabled", DECISION_LIFECYCLE_EXIT.rejected, error.status);
|
|
17669
|
+
}
|
|
17670
|
+
if (error.status === 503 && message === FEATURE_CHECK_UNAVAILABLE_MESSAGE) {
|
|
17671
|
+
return failure2("feature_check_unavailable", DECISION_LIFECYCLE_EXIT.server, error.status);
|
|
17672
|
+
}
|
|
17234
17673
|
if (error.status === 409 && message === AMBIGUOUS_MESSAGE) {
|
|
17235
17674
|
return failure2("ambiguous_identifier", DECISION_LIFECYCLE_EXIT.rejected, error.status);
|
|
17236
17675
|
}
|
|
@@ -17290,6 +17729,10 @@ function formatFailureHuman(operation, result) {
|
|
|
17290
17729
|
return `[prim] ${verb} rejected: Decision not found.`;
|
|
17291
17730
|
case "replacement_not_found":
|
|
17292
17731
|
return "[prim] supersede rejected: replacement Decision not found.";
|
|
17732
|
+
case "feature_disabled":
|
|
17733
|
+
return `[prim] ${verb} rejected: manual lifecycle actions are not enabled for this account.`;
|
|
17734
|
+
case "feature_check_unavailable":
|
|
17735
|
+
return `[prim] ${verb} unavailable: the server could not verify feature availability; retry shortly.`;
|
|
17293
17736
|
case "unsupported_server":
|
|
17294
17737
|
return `[prim] ${verb} unavailable: this Primitive server does not support this Decision lifecycle operation; upgrade the server before retrying.`;
|
|
17295
17738
|
case "rejected":
|
|
@@ -17358,6 +17801,18 @@ function ratifyDecision(id, dependencies = defaultDependencies3) {
|
|
|
17358
17801
|
const request = { id };
|
|
17359
17802
|
return executeLifecycle("ratify", request, dependencies);
|
|
17360
17803
|
}
|
|
17804
|
+
function promoteDecision(id, dependencies = defaultDependencies3) {
|
|
17805
|
+
const request = { id };
|
|
17806
|
+
return executeLifecycle("promote", request, dependencies);
|
|
17807
|
+
}
|
|
17808
|
+
function demoteDecision(id, dependencies = defaultDependencies3) {
|
|
17809
|
+
const request = { id };
|
|
17810
|
+
return executeLifecycle("demote", request, dependencies);
|
|
17811
|
+
}
|
|
17812
|
+
function withdrawDecision(id, dependencies = defaultDependencies3) {
|
|
17813
|
+
const request = { id };
|
|
17814
|
+
return executeLifecycle("withdraw", request, dependencies);
|
|
17815
|
+
}
|
|
17361
17816
|
function supersedeDecision(id, by, dependencies = defaultDependencies3) {
|
|
17362
17817
|
const request = { id, by };
|
|
17363
17818
|
return executeLifecycle("supersede", request, dependencies);
|
|
@@ -18210,6 +18665,19 @@ function registerDecisionsCommands(program2) {
|
|
|
18210
18665
|
decisions.command("ratify <idOrShortId>").description("Ratify an authored Decision as adopted").action(async (idOrShortId) => {
|
|
18211
18666
|
process.exitCode = await ratifyDecision(idOrShortId);
|
|
18212
18667
|
});
|
|
18668
|
+
decisions.command("promote <idOrShortId>").description("Promote an authored Decision to adopted, ratified guidance").action(async (idOrShortId) => {
|
|
18669
|
+
process.exitCode = await promoteDecision(idOrShortId);
|
|
18670
|
+
});
|
|
18671
|
+
decisions.command("demote <idOrShortId>").description(
|
|
18672
|
+
"Demote an authored adopted Decision back to provisional \u2014 advisory guidance only, no longer ratified"
|
|
18673
|
+
).action(async (idOrShortId) => {
|
|
18674
|
+
process.exitCode = await demoteDecision(idOrShortId);
|
|
18675
|
+
});
|
|
18676
|
+
decisions.command("withdraw <idOrShortId>").description(
|
|
18677
|
+
"Withdraw an authored Decision as abandoned \u2014 removed from active guidance but never deleted; `prim decisions restore` recovers it as a private draft"
|
|
18678
|
+
).action(async (idOrShortId) => {
|
|
18679
|
+
process.exitCode = await withdrawDecision(idOrShortId);
|
|
18680
|
+
});
|
|
18213
18681
|
decisions.command("supersede <idOrShortId>").description("Supersede a Decision with a distinct replacement Decision").requiredOption("--by <replacementIdOrShortId>", "Decision that replaces the named Decision").action(async (idOrShortId, opts) => {
|
|
18214
18682
|
process.exitCode = await supersedeDecision(idOrShortId, opts.by);
|
|
18215
18683
|
});
|
package/package.json
CHANGED