@mcesystems/apple-kit 1.0.47 → 1.0.49
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/README.md +7 -1
- package/dist/index.js +180 -132
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +178 -130
- package/dist/index.mjs.map +4 -4
- package/dist/types/logic/activationFlow.d.ts +1 -0
- package/dist/types/logic/activationFlow.d.ts.map +1 -1
- package/dist/types/types.d.ts +7 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/mdmClient.d.ts +4 -1
- package/dist/types/utils/mdmClient.d.ts.map +1 -1
- package/dist/types/utils/templateLoader.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/utils/portManager.d.ts +0 -68
- package/dist/types/utils/portManager.d.ts.map +0 -1
- /package/dist/{plist → resources/plist}/certificate-trust.xml +0 -0
- /package/dist/{plist → resources/plist}/wifi-enterprise.xml +0 -0
- /package/dist/{plist → resources/plist}/wifi-standard.xml +0 -0
package/dist/index.js
CHANGED
|
@@ -15027,19 +15027,19 @@ var require_printer = __commonJS({
|
|
|
15027
15027
|
},
|
|
15028
15028
|
// Document
|
|
15029
15029
|
Document: function Document(node) {
|
|
15030
|
-
return
|
|
15030
|
+
return join9(node.definitions, "\n\n") + "\n";
|
|
15031
15031
|
},
|
|
15032
15032
|
OperationDefinition: function OperationDefinition(node) {
|
|
15033
15033
|
var op = node.operation;
|
|
15034
15034
|
var name = node.name;
|
|
15035
|
-
var varDefs = wrap("(",
|
|
15036
|
-
var directives =
|
|
15035
|
+
var varDefs = wrap("(", join9(node.variableDefinitions, ", "), ")");
|
|
15036
|
+
var directives = join9(node.directives, " ");
|
|
15037
15037
|
var selectionSet = node.selectionSet;
|
|
15038
|
-
return !name && !directives && !varDefs && op === "query" ? selectionSet :
|
|
15038
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join9([op, join9([name, varDefs]), directives, selectionSet], " ");
|
|
15039
15039
|
},
|
|
15040
15040
|
VariableDefinition: function VariableDefinition(_ref) {
|
|
15041
15041
|
var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives;
|
|
15042
|
-
return variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ",
|
|
15042
|
+
return variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join9(directives, " "));
|
|
15043
15043
|
},
|
|
15044
15044
|
SelectionSet: function SelectionSet(_ref2) {
|
|
15045
15045
|
var selections = _ref2.selections;
|
|
@@ -15047,7 +15047,7 @@ var require_printer = __commonJS({
|
|
|
15047
15047
|
},
|
|
15048
15048
|
Field: function Field(_ref3) {
|
|
15049
15049
|
var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet;
|
|
15050
|
-
return
|
|
15050
|
+
return join9([wrap("", alias, ": ") + name + wrap("(", join9(args, ", "), ")"), join9(directives, " "), selectionSet], " ");
|
|
15051
15051
|
},
|
|
15052
15052
|
Argument: function Argument(_ref4) {
|
|
15053
15053
|
var name = _ref4.name, value = _ref4.value;
|
|
@@ -15056,18 +15056,18 @@ var require_printer = __commonJS({
|
|
|
15056
15056
|
// Fragments
|
|
15057
15057
|
FragmentSpread: function FragmentSpread(_ref5) {
|
|
15058
15058
|
var name = _ref5.name, directives = _ref5.directives;
|
|
15059
|
-
return "..." + name + wrap(" ",
|
|
15059
|
+
return "..." + name + wrap(" ", join9(directives, " "));
|
|
15060
15060
|
},
|
|
15061
15061
|
InlineFragment: function InlineFragment(_ref6) {
|
|
15062
15062
|
var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet;
|
|
15063
|
-
return
|
|
15063
|
+
return join9(["...", wrap("on ", typeCondition), join9(directives, " "), selectionSet], " ");
|
|
15064
15064
|
},
|
|
15065
15065
|
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
15066
15066
|
var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet;
|
|
15067
15067
|
return (
|
|
15068
15068
|
// Note: fragment variable definitions are experimental and may be changed
|
|
15069
15069
|
// or removed in the future.
|
|
15070
|
-
"fragment ".concat(name).concat(wrap("(",
|
|
15070
|
+
"fragment ".concat(name).concat(wrap("(", join9(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap("", join9(directives, " "), " ")) + selectionSet
|
|
15071
15071
|
);
|
|
15072
15072
|
},
|
|
15073
15073
|
// Value
|
|
@@ -15096,11 +15096,11 @@ var require_printer = __commonJS({
|
|
|
15096
15096
|
},
|
|
15097
15097
|
ListValue: function ListValue(_ref13) {
|
|
15098
15098
|
var values = _ref13.values;
|
|
15099
|
-
return "[" +
|
|
15099
|
+
return "[" + join9(values, ", ") + "]";
|
|
15100
15100
|
},
|
|
15101
15101
|
ObjectValue: function ObjectValue(_ref14) {
|
|
15102
15102
|
var fields = _ref14.fields;
|
|
15103
|
-
return "{" +
|
|
15103
|
+
return "{" + join9(fields, ", ") + "}";
|
|
15104
15104
|
},
|
|
15105
15105
|
ObjectField: function ObjectField(_ref15) {
|
|
15106
15106
|
var name = _ref15.name, value = _ref15.value;
|
|
@@ -15109,7 +15109,7 @@ var require_printer = __commonJS({
|
|
|
15109
15109
|
// Directive
|
|
15110
15110
|
Directive: function Directive(_ref16) {
|
|
15111
15111
|
var name = _ref16.name, args = _ref16.arguments;
|
|
15112
|
-
return "@" + name + wrap("(",
|
|
15112
|
+
return "@" + name + wrap("(", join9(args, ", "), ")");
|
|
15113
15113
|
},
|
|
15114
15114
|
// Type
|
|
15115
15115
|
NamedType: function NamedType(_ref17) {
|
|
@@ -15127,7 +15127,7 @@ var require_printer = __commonJS({
|
|
|
15127
15127
|
// Type System Definitions
|
|
15128
15128
|
SchemaDefinition: function SchemaDefinition(_ref20) {
|
|
15129
15129
|
var directives = _ref20.directives, operationTypes = _ref20.operationTypes;
|
|
15130
|
-
return
|
|
15130
|
+
return join9(["schema", join9(directives, " "), block(operationTypes)], " ");
|
|
15131
15131
|
},
|
|
15132
15132
|
OperationTypeDefinition: function OperationTypeDefinition(_ref21) {
|
|
15133
15133
|
var operation = _ref21.operation, type = _ref21.type;
|
|
@@ -15135,85 +15135,85 @@ var require_printer = __commonJS({
|
|
|
15135
15135
|
},
|
|
15136
15136
|
ScalarTypeDefinition: addDescription(function(_ref22) {
|
|
15137
15137
|
var name = _ref22.name, directives = _ref22.directives;
|
|
15138
|
-
return
|
|
15138
|
+
return join9(["scalar", name, join9(directives, " ")], " ");
|
|
15139
15139
|
}),
|
|
15140
15140
|
ObjectTypeDefinition: addDescription(function(_ref23) {
|
|
15141
15141
|
var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields;
|
|
15142
|
-
return
|
|
15142
|
+
return join9(["type", name, wrap("implements ", join9(interfaces, " & ")), join9(directives, " "), block(fields)], " ");
|
|
15143
15143
|
}),
|
|
15144
15144
|
FieldDefinition: addDescription(function(_ref24) {
|
|
15145
15145
|
var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives;
|
|
15146
|
-
return name + (hasMultilineItems(args) ? wrap("(\n", indent(
|
|
15146
|
+
return name + (hasMultilineItems(args) ? wrap("(\n", indent(join9(args, "\n")), "\n)") : wrap("(", join9(args, ", "), ")")) + ": " + type + wrap(" ", join9(directives, " "));
|
|
15147
15147
|
}),
|
|
15148
15148
|
InputValueDefinition: addDescription(function(_ref25) {
|
|
15149
15149
|
var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives;
|
|
15150
|
-
return
|
|
15150
|
+
return join9([name + ": " + type, wrap("= ", defaultValue), join9(directives, " ")], " ");
|
|
15151
15151
|
}),
|
|
15152
15152
|
InterfaceTypeDefinition: addDescription(function(_ref26) {
|
|
15153
15153
|
var name = _ref26.name, directives = _ref26.directives, fields = _ref26.fields;
|
|
15154
|
-
return
|
|
15154
|
+
return join9(["interface", name, join9(directives, " "), block(fields)], " ");
|
|
15155
15155
|
}),
|
|
15156
15156
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
15157
15157
|
var name = _ref27.name, directives = _ref27.directives, types = _ref27.types;
|
|
15158
|
-
return
|
|
15158
|
+
return join9(["union", name, join9(directives, " "), types && types.length !== 0 ? "= " + join9(types, " | ") : ""], " ");
|
|
15159
15159
|
}),
|
|
15160
15160
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
15161
15161
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
15162
|
-
return
|
|
15162
|
+
return join9(["enum", name, join9(directives, " "), block(values)], " ");
|
|
15163
15163
|
}),
|
|
15164
15164
|
EnumValueDefinition: addDescription(function(_ref29) {
|
|
15165
15165
|
var name = _ref29.name, directives = _ref29.directives;
|
|
15166
|
-
return
|
|
15166
|
+
return join9([name, join9(directives, " ")], " ");
|
|
15167
15167
|
}),
|
|
15168
15168
|
InputObjectTypeDefinition: addDescription(function(_ref30) {
|
|
15169
15169
|
var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields;
|
|
15170
|
-
return
|
|
15170
|
+
return join9(["input", name, join9(directives, " "), block(fields)], " ");
|
|
15171
15171
|
}),
|
|
15172
15172
|
DirectiveDefinition: addDescription(function(_ref31) {
|
|
15173
15173
|
var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations;
|
|
15174
|
-
return "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(
|
|
15174
|
+
return "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join9(args, "\n")), "\n)") : wrap("(", join9(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join9(locations, " | ");
|
|
15175
15175
|
}),
|
|
15176
15176
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
15177
15177
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
15178
|
-
return
|
|
15178
|
+
return join9(["extend schema", join9(directives, " "), block(operationTypes)], " ");
|
|
15179
15179
|
},
|
|
15180
15180
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
15181
15181
|
var name = _ref33.name, directives = _ref33.directives;
|
|
15182
|
-
return
|
|
15182
|
+
return join9(["extend scalar", name, join9(directives, " ")], " ");
|
|
15183
15183
|
},
|
|
15184
15184
|
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
15185
15185
|
var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields;
|
|
15186
|
-
return
|
|
15186
|
+
return join9(["extend type", name, wrap("implements ", join9(interfaces, " & ")), join9(directives, " "), block(fields)], " ");
|
|
15187
15187
|
},
|
|
15188
15188
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
15189
15189
|
var name = _ref35.name, directives = _ref35.directives, fields = _ref35.fields;
|
|
15190
|
-
return
|
|
15190
|
+
return join9(["extend interface", name, join9(directives, " "), block(fields)], " ");
|
|
15191
15191
|
},
|
|
15192
15192
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
15193
15193
|
var name = _ref36.name, directives = _ref36.directives, types = _ref36.types;
|
|
15194
|
-
return
|
|
15194
|
+
return join9(["extend union", name, join9(directives, " "), types && types.length !== 0 ? "= " + join9(types, " | ") : ""], " ");
|
|
15195
15195
|
},
|
|
15196
15196
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
15197
15197
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
15198
|
-
return
|
|
15198
|
+
return join9(["extend enum", name, join9(directives, " "), block(values)], " ");
|
|
15199
15199
|
},
|
|
15200
15200
|
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
15201
15201
|
var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields;
|
|
15202
|
-
return
|
|
15202
|
+
return join9(["extend input", name, join9(directives, " "), block(fields)], " ");
|
|
15203
15203
|
}
|
|
15204
15204
|
};
|
|
15205
15205
|
function addDescription(cb) {
|
|
15206
15206
|
return function(node) {
|
|
15207
|
-
return
|
|
15207
|
+
return join9([node.description, cb(node)], "\n");
|
|
15208
15208
|
};
|
|
15209
15209
|
}
|
|
15210
|
-
function
|
|
15210
|
+
function join9(maybeArray, separator) {
|
|
15211
15211
|
return maybeArray ? maybeArray.filter(function(x) {
|
|
15212
15212
|
return x;
|
|
15213
15213
|
}).join(separator || "") : "";
|
|
15214
15214
|
}
|
|
15215
15215
|
function block(array) {
|
|
15216
|
-
return array && array.length !== 0 ? "{\n" + indent(
|
|
15216
|
+
return array && array.length !== 0 ? "{\n" + indent(join9(array, "\n")) + "\n}" : "";
|
|
15217
15217
|
}
|
|
15218
15218
|
function wrap(start, maybeString, end) {
|
|
15219
15219
|
return maybeString ? start + maybeString + (end || "") : "";
|
|
@@ -15370,9 +15370,9 @@ var require_iterall = __commonJS({
|
|
|
15370
15370
|
};
|
|
15371
15371
|
function unwrapAsyncFromSync(iterator, fn, value) {
|
|
15372
15372
|
var step;
|
|
15373
|
-
return new Promise(function(
|
|
15373
|
+
return new Promise(function(resolve3) {
|
|
15374
15374
|
step = iterator[fn](value);
|
|
15375
|
-
|
|
15375
|
+
resolve3(step.value);
|
|
15376
15376
|
}).then(function(value2) {
|
|
15377
15377
|
return { value: value2, done: step.done };
|
|
15378
15378
|
});
|
|
@@ -15381,13 +15381,13 @@ var require_iterall = __commonJS({
|
|
|
15381
15381
|
var asyncIterator = createAsyncIterator(source);
|
|
15382
15382
|
if (asyncIterator) {
|
|
15383
15383
|
var i = 0;
|
|
15384
|
-
return new Promise(function(
|
|
15384
|
+
return new Promise(function(resolve3, reject) {
|
|
15385
15385
|
function next() {
|
|
15386
15386
|
asyncIterator.next().then(function(step) {
|
|
15387
15387
|
if (!step.done) {
|
|
15388
15388
|
Promise.resolve(callback.call(thisArg, step.value, i++, source)).then(next).catch(reject);
|
|
15389
15389
|
} else {
|
|
15390
|
-
|
|
15390
|
+
resolve3();
|
|
15391
15391
|
}
|
|
15392
15392
|
return null;
|
|
15393
15393
|
}).catch(reject);
|
|
@@ -15567,35 +15567,35 @@ var require_introspection = __commonJS({
|
|
|
15567
15567
|
types: {
|
|
15568
15568
|
description: "A list of all types supported by this server.",
|
|
15569
15569
|
type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type))),
|
|
15570
|
-
resolve: function
|
|
15570
|
+
resolve: function resolve3(schema) {
|
|
15571
15571
|
return (0, _objectValues.default)(schema.getTypeMap());
|
|
15572
15572
|
}
|
|
15573
15573
|
},
|
|
15574
15574
|
queryType: {
|
|
15575
15575
|
description: "The type that query operations will be rooted at.",
|
|
15576
15576
|
type: (0, _definition.GraphQLNonNull)(__Type),
|
|
15577
|
-
resolve: function
|
|
15577
|
+
resolve: function resolve3(schema) {
|
|
15578
15578
|
return schema.getQueryType();
|
|
15579
15579
|
}
|
|
15580
15580
|
},
|
|
15581
15581
|
mutationType: {
|
|
15582
15582
|
description: "If this server supports mutation, the type that mutation operations will be rooted at.",
|
|
15583
15583
|
type: __Type,
|
|
15584
|
-
resolve: function
|
|
15584
|
+
resolve: function resolve3(schema) {
|
|
15585
15585
|
return schema.getMutationType();
|
|
15586
15586
|
}
|
|
15587
15587
|
},
|
|
15588
15588
|
subscriptionType: {
|
|
15589
15589
|
description: "If this server support subscription, the type that subscription operations will be rooted at.",
|
|
15590
15590
|
type: __Type,
|
|
15591
|
-
resolve: function
|
|
15591
|
+
resolve: function resolve3(schema) {
|
|
15592
15592
|
return schema.getSubscriptionType();
|
|
15593
15593
|
}
|
|
15594
15594
|
},
|
|
15595
15595
|
directives: {
|
|
15596
15596
|
description: "A list of all directives supported by this server.",
|
|
15597
15597
|
type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Directive))),
|
|
15598
|
-
resolve: function
|
|
15598
|
+
resolve: function resolve3(schema) {
|
|
15599
15599
|
return schema.getDirectives();
|
|
15600
15600
|
}
|
|
15601
15601
|
}
|
|
@@ -15610,25 +15610,25 @@ var require_introspection = __commonJS({
|
|
|
15610
15610
|
return {
|
|
15611
15611
|
name: {
|
|
15612
15612
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString),
|
|
15613
|
-
resolve: function
|
|
15613
|
+
resolve: function resolve3(obj) {
|
|
15614
15614
|
return obj.name;
|
|
15615
15615
|
}
|
|
15616
15616
|
},
|
|
15617
15617
|
description: {
|
|
15618
15618
|
type: _scalars.GraphQLString,
|
|
15619
|
-
resolve: function
|
|
15619
|
+
resolve: function resolve3(obj) {
|
|
15620
15620
|
return obj.description;
|
|
15621
15621
|
}
|
|
15622
15622
|
},
|
|
15623
15623
|
locations: {
|
|
15624
15624
|
type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__DirectiveLocation))),
|
|
15625
|
-
resolve: function
|
|
15625
|
+
resolve: function resolve3(obj) {
|
|
15626
15626
|
return obj.locations;
|
|
15627
15627
|
}
|
|
15628
15628
|
},
|
|
15629
15629
|
args: {
|
|
15630
15630
|
type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))),
|
|
15631
|
-
resolve: function
|
|
15631
|
+
resolve: function resolve3(directive) {
|
|
15632
15632
|
return directive.args;
|
|
15633
15633
|
}
|
|
15634
15634
|
}
|
|
@@ -15726,7 +15726,7 @@ var require_introspection = __commonJS({
|
|
|
15726
15726
|
return {
|
|
15727
15727
|
kind: {
|
|
15728
15728
|
type: (0, _definition.GraphQLNonNull)(__TypeKind),
|
|
15729
|
-
resolve: function
|
|
15729
|
+
resolve: function resolve3(type) {
|
|
15730
15730
|
if ((0, _definition.isScalarType)(type)) {
|
|
15731
15731
|
return TypeKind.SCALAR;
|
|
15732
15732
|
} else if ((0, _definition.isObjectType)(type)) {
|
|
@@ -15749,13 +15749,13 @@ var require_introspection = __commonJS({
|
|
|
15749
15749
|
},
|
|
15750
15750
|
name: {
|
|
15751
15751
|
type: _scalars.GraphQLString,
|
|
15752
|
-
resolve: function
|
|
15752
|
+
resolve: function resolve3(obj) {
|
|
15753
15753
|
return obj.name !== void 0 ? obj.name : void 0;
|
|
15754
15754
|
}
|
|
15755
15755
|
},
|
|
15756
15756
|
description: {
|
|
15757
15757
|
type: _scalars.GraphQLString,
|
|
15758
|
-
resolve: function
|
|
15758
|
+
resolve: function resolve3(obj) {
|
|
15759
15759
|
return obj.description !== void 0 ? obj.description : void 0;
|
|
15760
15760
|
}
|
|
15761
15761
|
},
|
|
@@ -15767,7 +15767,7 @@ var require_introspection = __commonJS({
|
|
|
15767
15767
|
defaultValue: false
|
|
15768
15768
|
}
|
|
15769
15769
|
},
|
|
15770
|
-
resolve: function
|
|
15770
|
+
resolve: function resolve3(type, _ref) {
|
|
15771
15771
|
var includeDeprecated = _ref.includeDeprecated;
|
|
15772
15772
|
if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) {
|
|
15773
15773
|
var fields2 = (0, _objectValues.default)(type.getFields());
|
|
@@ -15783,7 +15783,7 @@ var require_introspection = __commonJS({
|
|
|
15783
15783
|
},
|
|
15784
15784
|
interfaces: {
|
|
15785
15785
|
type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)),
|
|
15786
|
-
resolve: function
|
|
15786
|
+
resolve: function resolve3(type) {
|
|
15787
15787
|
if ((0, _definition.isObjectType)(type)) {
|
|
15788
15788
|
return type.getInterfaces();
|
|
15789
15789
|
}
|
|
@@ -15791,7 +15791,7 @@ var require_introspection = __commonJS({
|
|
|
15791
15791
|
},
|
|
15792
15792
|
possibleTypes: {
|
|
15793
15793
|
type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)),
|
|
15794
|
-
resolve: function
|
|
15794
|
+
resolve: function resolve3(type, args, context, _ref2) {
|
|
15795
15795
|
var schema = _ref2.schema;
|
|
15796
15796
|
if ((0, _definition.isAbstractType)(type)) {
|
|
15797
15797
|
return schema.getPossibleTypes(type);
|
|
@@ -15806,7 +15806,7 @@ var require_introspection = __commonJS({
|
|
|
15806
15806
|
defaultValue: false
|
|
15807
15807
|
}
|
|
15808
15808
|
},
|
|
15809
|
-
resolve: function
|
|
15809
|
+
resolve: function resolve3(type, _ref3) {
|
|
15810
15810
|
var includeDeprecated = _ref3.includeDeprecated;
|
|
15811
15811
|
if ((0, _definition.isEnumType)(type)) {
|
|
15812
15812
|
var values = type.getValues();
|
|
@@ -15821,7 +15821,7 @@ var require_introspection = __commonJS({
|
|
|
15821
15821
|
},
|
|
15822
15822
|
inputFields: {
|
|
15823
15823
|
type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue)),
|
|
15824
|
-
resolve: function
|
|
15824
|
+
resolve: function resolve3(type) {
|
|
15825
15825
|
if ((0, _definition.isInputObjectType)(type)) {
|
|
15826
15826
|
return (0, _objectValues.default)(type.getFields());
|
|
15827
15827
|
}
|
|
@@ -15829,7 +15829,7 @@ var require_introspection = __commonJS({
|
|
|
15829
15829
|
},
|
|
15830
15830
|
ofType: {
|
|
15831
15831
|
type: __Type,
|
|
15832
|
-
resolve: function
|
|
15832
|
+
resolve: function resolve3(obj) {
|
|
15833
15833
|
return obj.ofType !== void 0 ? obj.ofType : void 0;
|
|
15834
15834
|
}
|
|
15835
15835
|
}
|
|
@@ -15844,37 +15844,37 @@ var require_introspection = __commonJS({
|
|
|
15844
15844
|
return {
|
|
15845
15845
|
name: {
|
|
15846
15846
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString),
|
|
15847
|
-
resolve: function
|
|
15847
|
+
resolve: function resolve3(obj) {
|
|
15848
15848
|
return obj.name;
|
|
15849
15849
|
}
|
|
15850
15850
|
},
|
|
15851
15851
|
description: {
|
|
15852
15852
|
type: _scalars.GraphQLString,
|
|
15853
|
-
resolve: function
|
|
15853
|
+
resolve: function resolve3(obj) {
|
|
15854
15854
|
return obj.description;
|
|
15855
15855
|
}
|
|
15856
15856
|
},
|
|
15857
15857
|
args: {
|
|
15858
15858
|
type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))),
|
|
15859
|
-
resolve: function
|
|
15859
|
+
resolve: function resolve3(field) {
|
|
15860
15860
|
return field.args;
|
|
15861
15861
|
}
|
|
15862
15862
|
},
|
|
15863
15863
|
type: {
|
|
15864
15864
|
type: (0, _definition.GraphQLNonNull)(__Type),
|
|
15865
|
-
resolve: function
|
|
15865
|
+
resolve: function resolve3(obj) {
|
|
15866
15866
|
return obj.type;
|
|
15867
15867
|
}
|
|
15868
15868
|
},
|
|
15869
15869
|
isDeprecated: {
|
|
15870
15870
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean),
|
|
15871
|
-
resolve: function
|
|
15871
|
+
resolve: function resolve3(obj) {
|
|
15872
15872
|
return obj.isDeprecated;
|
|
15873
15873
|
}
|
|
15874
15874
|
},
|
|
15875
15875
|
deprecationReason: {
|
|
15876
15876
|
type: _scalars.GraphQLString,
|
|
15877
|
-
resolve: function
|
|
15877
|
+
resolve: function resolve3(obj) {
|
|
15878
15878
|
return obj.deprecationReason;
|
|
15879
15879
|
}
|
|
15880
15880
|
}
|
|
@@ -15889,26 +15889,26 @@ var require_introspection = __commonJS({
|
|
|
15889
15889
|
return {
|
|
15890
15890
|
name: {
|
|
15891
15891
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString),
|
|
15892
|
-
resolve: function
|
|
15892
|
+
resolve: function resolve3(obj) {
|
|
15893
15893
|
return obj.name;
|
|
15894
15894
|
}
|
|
15895
15895
|
},
|
|
15896
15896
|
description: {
|
|
15897
15897
|
type: _scalars.GraphQLString,
|
|
15898
|
-
resolve: function
|
|
15898
|
+
resolve: function resolve3(obj) {
|
|
15899
15899
|
return obj.description;
|
|
15900
15900
|
}
|
|
15901
15901
|
},
|
|
15902
15902
|
type: {
|
|
15903
15903
|
type: (0, _definition.GraphQLNonNull)(__Type),
|
|
15904
|
-
resolve: function
|
|
15904
|
+
resolve: function resolve3(obj) {
|
|
15905
15905
|
return obj.type;
|
|
15906
15906
|
}
|
|
15907
15907
|
},
|
|
15908
15908
|
defaultValue: {
|
|
15909
15909
|
type: _scalars.GraphQLString,
|
|
15910
15910
|
description: "A GraphQL-formatted string representing the default value for this input value.",
|
|
15911
|
-
resolve: function
|
|
15911
|
+
resolve: function resolve3(inputVal) {
|
|
15912
15912
|
var valueAST = (0, _astFromValue.astFromValue)(inputVal.defaultValue, inputVal.type);
|
|
15913
15913
|
return valueAST ? (0, _printer.print)(valueAST) : null;
|
|
15914
15914
|
}
|
|
@@ -15924,25 +15924,25 @@ var require_introspection = __commonJS({
|
|
|
15924
15924
|
return {
|
|
15925
15925
|
name: {
|
|
15926
15926
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString),
|
|
15927
|
-
resolve: function
|
|
15927
|
+
resolve: function resolve3(obj) {
|
|
15928
15928
|
return obj.name;
|
|
15929
15929
|
}
|
|
15930
15930
|
},
|
|
15931
15931
|
description: {
|
|
15932
15932
|
type: _scalars.GraphQLString,
|
|
15933
|
-
resolve: function
|
|
15933
|
+
resolve: function resolve3(obj) {
|
|
15934
15934
|
return obj.description;
|
|
15935
15935
|
}
|
|
15936
15936
|
},
|
|
15937
15937
|
isDeprecated: {
|
|
15938
15938
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean),
|
|
15939
|
-
resolve: function
|
|
15939
|
+
resolve: function resolve3(obj) {
|
|
15940
15940
|
return obj.isDeprecated;
|
|
15941
15941
|
}
|
|
15942
15942
|
},
|
|
15943
15943
|
deprecationReason: {
|
|
15944
15944
|
type: _scalars.GraphQLString,
|
|
15945
|
-
resolve: function
|
|
15945
|
+
resolve: function resolve3(obj) {
|
|
15946
15946
|
return obj.deprecationReason;
|
|
15947
15947
|
}
|
|
15948
15948
|
}
|
|
@@ -16005,7 +16005,7 @@ var require_introspection = __commonJS({
|
|
|
16005
16005
|
type: (0, _definition.GraphQLNonNull)(__Schema),
|
|
16006
16006
|
description: "Access the current type schema of this server.",
|
|
16007
16007
|
args: [],
|
|
16008
|
-
resolve: function
|
|
16008
|
+
resolve: function resolve3(source, args, context, _ref4) {
|
|
16009
16009
|
var schema = _ref4.schema;
|
|
16010
16010
|
return schema;
|
|
16011
16011
|
},
|
|
@@ -16026,7 +16026,7 @@ var require_introspection = __commonJS({
|
|
|
16026
16026
|
extensions: void 0,
|
|
16027
16027
|
astNode: void 0
|
|
16028
16028
|
}],
|
|
16029
|
-
resolve: function
|
|
16029
|
+
resolve: function resolve3(source, _ref5, context, _ref6) {
|
|
16030
16030
|
var name = _ref5.name;
|
|
16031
16031
|
var schema = _ref6.schema;
|
|
16032
16032
|
return schema.getType(name);
|
|
@@ -16041,7 +16041,7 @@ var require_introspection = __commonJS({
|
|
|
16041
16041
|
type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString),
|
|
16042
16042
|
description: "The name of the current Object type at runtime.",
|
|
16043
16043
|
args: [],
|
|
16044
|
-
resolve: function
|
|
16044
|
+
resolve: function resolve3(source, args, context, _ref7) {
|
|
16045
16045
|
var parentType = _ref7.parentType;
|
|
16046
16046
|
return parentType.name;
|
|
16047
16047
|
},
|
|
@@ -20545,8 +20545,8 @@ var require_graphql = __commonJS({
|
|
|
20545
20545
|
}
|
|
20546
20546
|
function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
20547
20547
|
var _arguments = arguments;
|
|
20548
|
-
return new Promise(function(
|
|
20549
|
-
return
|
|
20548
|
+
return new Promise(function(resolve3) {
|
|
20549
|
+
return resolve3(
|
|
20550
20550
|
// Extract arguments from object args if provided.
|
|
20551
20551
|
_arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({
|
|
20552
20552
|
schema: argsOrSchema,
|
|
@@ -21396,8 +21396,8 @@ var require_mapAsyncIterator = __commonJS({
|
|
|
21396
21396
|
});
|
|
21397
21397
|
}
|
|
21398
21398
|
function asyncMapValue(value, callback) {
|
|
21399
|
-
return new Promise(function(
|
|
21400
|
-
return
|
|
21399
|
+
return new Promise(function(resolve3) {
|
|
21400
|
+
return resolve3(callback(value));
|
|
21401
21401
|
});
|
|
21402
21402
|
}
|
|
21403
21403
|
function iteratorResult(value) {
|
|
@@ -31146,7 +31146,7 @@ var require_lib3 = __commonJS({
|
|
|
31146
31146
|
let accum = [];
|
|
31147
31147
|
let accumBytes = 0;
|
|
31148
31148
|
let abort = false;
|
|
31149
|
-
return new Body.Promise(function(
|
|
31149
|
+
return new Body.Promise(function(resolve3, reject) {
|
|
31150
31150
|
let resTimeout;
|
|
31151
31151
|
if (_this4.timeout) {
|
|
31152
31152
|
resTimeout = setTimeout(function() {
|
|
@@ -31180,7 +31180,7 @@ var require_lib3 = __commonJS({
|
|
|
31180
31180
|
}
|
|
31181
31181
|
clearTimeout(resTimeout);
|
|
31182
31182
|
try {
|
|
31183
|
-
|
|
31183
|
+
resolve3(Buffer.concat(accum, accumBytes));
|
|
31184
31184
|
} catch (err) {
|
|
31185
31185
|
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
|
|
31186
31186
|
}
|
|
@@ -31855,7 +31855,7 @@ var require_lib3 = __commonJS({
|
|
|
31855
31855
|
throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
|
|
31856
31856
|
}
|
|
31857
31857
|
Body.Promise = fetch2.Promise;
|
|
31858
|
-
return new fetch2.Promise(function(
|
|
31858
|
+
return new fetch2.Promise(function(resolve3, reject) {
|
|
31859
31859
|
const request = new Request(url, opts);
|
|
31860
31860
|
const options = getNodeRequestOptions(request);
|
|
31861
31861
|
const send = (options.protocol === "https:" ? https : http).request;
|
|
@@ -31988,7 +31988,7 @@ var require_lib3 = __commonJS({
|
|
|
31988
31988
|
requestOpts.body = void 0;
|
|
31989
31989
|
requestOpts.headers.delete("content-length");
|
|
31990
31990
|
}
|
|
31991
|
-
|
|
31991
|
+
resolve3(fetch2(new Request(locationURL, requestOpts)));
|
|
31992
31992
|
finalize();
|
|
31993
31993
|
return;
|
|
31994
31994
|
}
|
|
@@ -32009,7 +32009,7 @@ var require_lib3 = __commonJS({
|
|
|
32009
32009
|
const codings = headers.get("Content-Encoding");
|
|
32010
32010
|
if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
32011
32011
|
response = new Response(body, response_options);
|
|
32012
|
-
|
|
32012
|
+
resolve3(response);
|
|
32013
32013
|
return;
|
|
32014
32014
|
}
|
|
32015
32015
|
const zlibOptions = {
|
|
@@ -32019,7 +32019,7 @@ var require_lib3 = __commonJS({
|
|
|
32019
32019
|
if (codings == "gzip" || codings == "x-gzip") {
|
|
32020
32020
|
body = body.pipe(zlib.createGunzip(zlibOptions));
|
|
32021
32021
|
response = new Response(body, response_options);
|
|
32022
|
-
|
|
32022
|
+
resolve3(response);
|
|
32023
32023
|
return;
|
|
32024
32024
|
}
|
|
32025
32025
|
if (codings == "deflate" || codings == "x-deflate") {
|
|
@@ -32031,12 +32031,12 @@ var require_lib3 = __commonJS({
|
|
|
32031
32031
|
body = body.pipe(zlib.createInflateRaw());
|
|
32032
32032
|
}
|
|
32033
32033
|
response = new Response(body, response_options);
|
|
32034
|
-
|
|
32034
|
+
resolve3(response);
|
|
32035
32035
|
});
|
|
32036
32036
|
raw.on("end", function() {
|
|
32037
32037
|
if (!response) {
|
|
32038
32038
|
response = new Response(body, response_options);
|
|
32039
|
-
|
|
32039
|
+
resolve3(response);
|
|
32040
32040
|
}
|
|
32041
32041
|
});
|
|
32042
32042
|
return;
|
|
@@ -32044,11 +32044,11 @@ var require_lib3 = __commonJS({
|
|
|
32044
32044
|
if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
|
|
32045
32045
|
body = body.pipe(zlib.createBrotliDecompress());
|
|
32046
32046
|
response = new Response(body, response_options);
|
|
32047
|
-
|
|
32047
|
+
resolve3(response);
|
|
32048
32048
|
return;
|
|
32049
32049
|
}
|
|
32050
32050
|
response = new Response(body, response_options);
|
|
32051
|
-
|
|
32051
|
+
resolve3(response);
|
|
32052
32052
|
});
|
|
32053
32053
|
writeToStream(req, request);
|
|
32054
32054
|
});
|
|
@@ -32151,14 +32151,14 @@ var getLocalHosts = () => {
|
|
|
32151
32151
|
}
|
|
32152
32152
|
return results;
|
|
32153
32153
|
};
|
|
32154
|
-
var checkAvailablePort = (options) => new Promise((
|
|
32154
|
+
var checkAvailablePort = (options) => new Promise((resolve3, reject) => {
|
|
32155
32155
|
const server = import_node_net.default.createServer();
|
|
32156
32156
|
server.unref();
|
|
32157
32157
|
server.on("error", reject);
|
|
32158
32158
|
server.listen(options, () => {
|
|
32159
32159
|
const { port } = server.address();
|
|
32160
32160
|
server.close(() => {
|
|
32161
|
-
|
|
32161
|
+
resolve3(port);
|
|
32162
32162
|
});
|
|
32163
32163
|
});
|
|
32164
32164
|
});
|
|
@@ -32478,6 +32478,9 @@ async function getDeviceInfo(udid) {
|
|
|
32478
32478
|
};
|
|
32479
32479
|
}
|
|
32480
32480
|
|
|
32481
|
+
// src/utils/mdmClient.ts
|
|
32482
|
+
var import_node_path4 = require("node:path");
|
|
32483
|
+
|
|
32481
32484
|
// ../../node_modules/.pnpm/graphql-request@5.2.0_encoding@0.1.13_graphql@14.7.0/node_modules/graphql-request/build/esm/defaultJsonSerializer.js
|
|
32482
32485
|
var defaultJsonSerializer = {
|
|
32483
32486
|
parse: JSON.parse,
|
|
@@ -32730,22 +32733,22 @@ var GraphQLWebSocketClient = class {
|
|
|
32730
32733
|
};
|
|
32731
32734
|
}
|
|
32732
32735
|
rawRequest(query, variables) {
|
|
32733
|
-
return new Promise((
|
|
32736
|
+
return new Promise((resolve3, reject) => {
|
|
32734
32737
|
let result;
|
|
32735
32738
|
this.rawSubscribe(query, {
|
|
32736
32739
|
next: (data, extensions) => result = { data, extensions },
|
|
32737
32740
|
error: reject,
|
|
32738
|
-
complete: () =>
|
|
32741
|
+
complete: () => resolve3(result)
|
|
32739
32742
|
}, variables);
|
|
32740
32743
|
});
|
|
32741
32744
|
}
|
|
32742
32745
|
request(document2, variables) {
|
|
32743
|
-
return new Promise((
|
|
32746
|
+
return new Promise((resolve3, reject) => {
|
|
32744
32747
|
let result;
|
|
32745
32748
|
this.subscribe(document2, {
|
|
32746
32749
|
next: (data) => result = data,
|
|
32747
32750
|
error: reject,
|
|
32748
|
-
complete: () =>
|
|
32751
|
+
complete: () => resolve3(result)
|
|
32749
32752
|
}, variables);
|
|
32750
32753
|
});
|
|
32751
32754
|
}
|
|
@@ -33249,9 +33252,9 @@ function createMdmClient(config) {
|
|
|
33249
33252
|
}
|
|
33250
33253
|
};
|
|
33251
33254
|
}
|
|
33252
|
-
async function createMdmClientFromEnv() {
|
|
33255
|
+
async function createMdmClientFromEnv(options) {
|
|
33253
33256
|
const endpoint = process.env.MDM_ENDPOINT;
|
|
33254
|
-
const credPath =
|
|
33257
|
+
const credPath = resolveCredentialsPath(options);
|
|
33255
33258
|
if (!endpoint || !credPath) {
|
|
33256
33259
|
return void 0;
|
|
33257
33260
|
}
|
|
@@ -33263,6 +33266,15 @@ async function createMdmClientFromEnv() {
|
|
|
33263
33266
|
timeout: 6e4
|
|
33264
33267
|
});
|
|
33265
33268
|
}
|
|
33269
|
+
function resolveCredentialsPath(options) {
|
|
33270
|
+
if (options?.credentialsPath) {
|
|
33271
|
+
return (0, import_node_path4.resolve)(options.credentialsPath);
|
|
33272
|
+
}
|
|
33273
|
+
if (options?.resourcesDir) {
|
|
33274
|
+
return (0, import_node_path4.join)((0, import_node_path4.resolve)(options.resourcesDir), "@clientLocal.json");
|
|
33275
|
+
}
|
|
33276
|
+
return process.env.MDM_CRED_PATH ?? process.env.APP_CRED_PATH;
|
|
33277
|
+
}
|
|
33266
33278
|
|
|
33267
33279
|
// src/logic/actions/pair.ts
|
|
33268
33280
|
async function isPaired(udid) {
|
|
@@ -33312,7 +33324,7 @@ async function waitForPairing(udid, timeout2 = 12e4, pollInterval = 1e3) {
|
|
|
33312
33324
|
logInfo(`Device ${udid} is now paired`);
|
|
33313
33325
|
return true;
|
|
33314
33326
|
}
|
|
33315
|
-
await new Promise((
|
|
33327
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
33316
33328
|
}
|
|
33317
33329
|
throw new Error(`Timeout waiting for device pairing after ${timeout2}ms`);
|
|
33318
33330
|
}
|
|
@@ -33400,7 +33412,7 @@ async function wakeDevice(udid) {
|
|
|
33400
33412
|
await runIDeviceTool("idevicepair", ["-u", udid, "validate"]);
|
|
33401
33413
|
} catch {
|
|
33402
33414
|
}
|
|
33403
|
-
await new Promise((
|
|
33415
|
+
await new Promise((resolve3) => setTimeout(resolve3, 1e3));
|
|
33404
33416
|
logInfo("Device wake attempt completed");
|
|
33405
33417
|
} catch (error) {
|
|
33406
33418
|
logInfo(
|
|
@@ -33432,7 +33444,7 @@ async function launchApp(bundleId, args, udid) {
|
|
|
33432
33444
|
throw new Error("debugserver_not_available");
|
|
33433
33445
|
}
|
|
33434
33446
|
logInfo(`App ${bundleId} launched successfully using idevicedebug`);
|
|
33435
|
-
await new Promise((
|
|
33447
|
+
await new Promise((resolve3) => setTimeout(resolve3, 1e3));
|
|
33436
33448
|
return;
|
|
33437
33449
|
} catch (error) {
|
|
33438
33450
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
@@ -33542,7 +33554,7 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33542
33554
|
);
|
|
33543
33555
|
}
|
|
33544
33556
|
logInfo(`App ${bundleId} launched successfully using pymobiledevice3 with tunnel`);
|
|
33545
|
-
await new Promise((
|
|
33557
|
+
await new Promise((resolve3) => setTimeout(resolve3, 500));
|
|
33546
33558
|
return;
|
|
33547
33559
|
} catch {
|
|
33548
33560
|
throw new Error(
|
|
@@ -33559,7 +33571,7 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33559
33571
|
logInfo(`Warning: pymobiledevice3 reported errors: ${output.substring(0, 300)}`);
|
|
33560
33572
|
}
|
|
33561
33573
|
logInfo(`App ${bundleId} launched successfully using pymobiledevice3`);
|
|
33562
|
-
await new Promise((
|
|
33574
|
+
await new Promise((resolve3) => setTimeout(resolve3, 1e3));
|
|
33563
33575
|
} catch (error) {
|
|
33564
33576
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
33565
33577
|
if (errorMsg.includes("not found") || errorMsg.includes("command not found") || errorMsg.includes("cannot find") || errorMsg.includes("No module named")) {
|
|
@@ -33573,13 +33585,13 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33573
33585
|
|
|
33574
33586
|
// src/logic/actions/proxy.ts
|
|
33575
33587
|
var import_node_child_process2 = require("node:child_process");
|
|
33576
|
-
var
|
|
33588
|
+
var import_node_path5 = require("node:path");
|
|
33577
33589
|
function startPortForward(localPort, devicePort, udid, startupTimeout = 500) {
|
|
33578
|
-
return new Promise((
|
|
33590
|
+
return new Promise((resolve3, reject) => {
|
|
33579
33591
|
logTask(`Starting port forward ${localPort} -> ${devicePort} for device ${udid}`);
|
|
33580
33592
|
const binPath = getResourcesBinPath();
|
|
33581
33593
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
33582
|
-
const toolPath = binPath ? (0,
|
|
33594
|
+
const toolPath = binPath ? (0, import_node_path5.join)(binPath, `iproxy${ext}`) : `iproxy${ext}`;
|
|
33583
33595
|
const spawnOptions = {
|
|
33584
33596
|
windowsHide: true,
|
|
33585
33597
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -33628,7 +33640,7 @@ function startPortForward(localPort, devicePort, udid, startupTimeout = 500) {
|
|
|
33628
33640
|
if (!hasResolved) {
|
|
33629
33641
|
hasResolved = true;
|
|
33630
33642
|
logTask(`Port forward started: ${localPort} -> ${devicePort} for device ${udid}`);
|
|
33631
|
-
|
|
33643
|
+
resolve3({
|
|
33632
33644
|
result: {
|
|
33633
33645
|
localPort,
|
|
33634
33646
|
devicePort
|
|
@@ -33650,58 +33662,73 @@ function killPortForwardProcess(process2) {
|
|
|
33650
33662
|
var import_node_fs4 = require("node:fs");
|
|
33651
33663
|
var import_promises3 = require("node:fs/promises");
|
|
33652
33664
|
var import_node_os3 = require("node:os");
|
|
33653
|
-
var
|
|
33665
|
+
var import_node_path8 = require("node:path");
|
|
33654
33666
|
var import_node_url2 = require("node:url");
|
|
33655
33667
|
|
|
33656
33668
|
// src/utils/trustProfile.ts
|
|
33657
33669
|
var import_node_crypto2 = require("node:crypto");
|
|
33658
33670
|
var import_promises2 = require("node:fs/promises");
|
|
33659
33671
|
var import_node_os2 = require("node:os");
|
|
33660
|
-
var
|
|
33672
|
+
var import_node_path7 = require("node:path");
|
|
33661
33673
|
|
|
33662
33674
|
// src/utils/templateLoader.ts
|
|
33663
33675
|
var import_node_fs3 = require("node:fs");
|
|
33664
33676
|
var import_promises = require("node:fs/promises");
|
|
33665
|
-
var
|
|
33677
|
+
var import_node_path6 = require("node:path");
|
|
33666
33678
|
var import_node_url = require("node:url");
|
|
33667
33679
|
var import_meta2 = {};
|
|
33680
|
+
function resolveEnvPlistDir() {
|
|
33681
|
+
const envPath = process.env.RESOURCES_PLIST_DIR || process.env.resourcesPlistDir;
|
|
33682
|
+
if (!envPath) {
|
|
33683
|
+
return null;
|
|
33684
|
+
}
|
|
33685
|
+
const absolutePath = (0, import_node_path6.isAbsolute)(envPath) ? envPath : (0, import_node_path6.join)(process.cwd(), envPath);
|
|
33686
|
+
if ((0, import_node_fs3.existsSync)(absolutePath)) {
|
|
33687
|
+
return absolutePath;
|
|
33688
|
+
}
|
|
33689
|
+
return null;
|
|
33690
|
+
}
|
|
33668
33691
|
function getPlistDir() {
|
|
33692
|
+
const envPlistDir = resolveEnvPlistDir();
|
|
33693
|
+
if (envPlistDir) {
|
|
33694
|
+
return envPlistDir;
|
|
33695
|
+
}
|
|
33669
33696
|
let baseDir;
|
|
33670
33697
|
try {
|
|
33671
33698
|
if (typeof import_meta2 !== "undefined" && import_meta2.url) {
|
|
33672
33699
|
const currentFile = (0, import_node_url.fileURLToPath)(import_meta2.url);
|
|
33673
|
-
baseDir = (0,
|
|
33700
|
+
baseDir = (0, import_node_path6.dirname)(currentFile);
|
|
33674
33701
|
} else {
|
|
33675
33702
|
baseDir = typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
33676
33703
|
}
|
|
33677
33704
|
} catch {
|
|
33678
33705
|
baseDir = process.cwd();
|
|
33679
33706
|
}
|
|
33680
|
-
const sourcePlistDir = (0,
|
|
33707
|
+
const sourcePlistDir = (0, import_node_path6.join)(baseDir, "../plist");
|
|
33681
33708
|
if ((0, import_node_fs3.existsSync)(sourcePlistDir)) {
|
|
33682
33709
|
return sourcePlistDir;
|
|
33683
33710
|
}
|
|
33684
|
-
const distPlistDir = (0,
|
|
33711
|
+
const distPlistDir = (0, import_node_path6.join)(baseDir, "../plist");
|
|
33685
33712
|
if ((0, import_node_fs3.existsSync)(distPlistDir)) {
|
|
33686
33713
|
return distPlistDir;
|
|
33687
33714
|
}
|
|
33688
|
-
const distPlistDir2 = (0,
|
|
33715
|
+
const distPlistDir2 = (0, import_node_path6.join)(baseDir, "../dist/plist");
|
|
33689
33716
|
if ((0, import_node_fs3.existsSync)(distPlistDir2)) {
|
|
33690
33717
|
return distPlistDir2;
|
|
33691
33718
|
}
|
|
33692
|
-
const srcPlistFallback = (0,
|
|
33719
|
+
const srcPlistFallback = (0, import_node_path6.join)(process.cwd(), "src/plist");
|
|
33693
33720
|
if ((0, import_node_fs3.existsSync)(srcPlistFallback)) {
|
|
33694
33721
|
return srcPlistFallback;
|
|
33695
33722
|
}
|
|
33696
|
-
const distPlistFallback = (0,
|
|
33723
|
+
const distPlistFallback = (0, import_node_path6.join)(process.cwd(), "dist/plist");
|
|
33697
33724
|
if ((0, import_node_fs3.existsSync)(distPlistFallback)) {
|
|
33698
33725
|
return distPlistFallback;
|
|
33699
33726
|
}
|
|
33700
|
-
return (0,
|
|
33727
|
+
return (0, import_node_path6.join)(process.cwd(), "src/plist");
|
|
33701
33728
|
}
|
|
33702
33729
|
var PLIST_DIR = getPlistDir();
|
|
33703
33730
|
async function loadTemplate(templateName) {
|
|
33704
|
-
const templatePath = (0,
|
|
33731
|
+
const templatePath = (0, import_node_path6.join)(PLIST_DIR, templateName);
|
|
33705
33732
|
const content = await (0, import_promises.readFile)(templatePath, "utf-8");
|
|
33706
33733
|
return content;
|
|
33707
33734
|
}
|
|
@@ -33903,7 +33930,7 @@ function parseWifiEapType(value) {
|
|
|
33903
33930
|
// src/logic/iosCli.ts
|
|
33904
33931
|
var import_node_child_process3 = require("node:child_process");
|
|
33905
33932
|
function runIosCommand(iosBinaryPath, args) {
|
|
33906
|
-
return new Promise((
|
|
33933
|
+
return new Promise((resolve3, reject) => {
|
|
33907
33934
|
const child = (0, import_node_child_process3.spawn)(iosBinaryPath, args, {
|
|
33908
33935
|
windowsHide: true,
|
|
33909
33936
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -33929,7 +33956,7 @@ function runIosCommand(iosBinaryPath, args) {
|
|
|
33929
33956
|
msg: lineJson.msg,
|
|
33930
33957
|
timestamp: lineJson.timestamp
|
|
33931
33958
|
}));
|
|
33932
|
-
|
|
33959
|
+
resolve3({
|
|
33933
33960
|
command: iosBinaryPath,
|
|
33934
33961
|
args,
|
|
33935
33962
|
output,
|
|
@@ -33994,10 +34021,16 @@ var ActivationFlow = class {
|
|
|
33994
34021
|
iosCli;
|
|
33995
34022
|
mdmClientPromise;
|
|
33996
34023
|
organizationName;
|
|
34024
|
+
resourcesDir;
|
|
33997
34025
|
constructor(config) {
|
|
33998
|
-
|
|
33999
|
-
|
|
34026
|
+
const iosBinaryPath = resolveIosBinaryPath(config);
|
|
34027
|
+
if (!iosBinaryPath) {
|
|
34028
|
+
throw new Error("iosBinaryPath is required. Provide iosBinaryPath or resourcesDir.");
|
|
34029
|
+
}
|
|
34030
|
+
this.iosCli = createIosCli(iosBinaryPath);
|
|
34031
|
+
this.mdmClientPromise = createMdmClientFromEnv({ resourcesDir: config.resourcesDir });
|
|
34000
34032
|
this.organizationName = config.organizationName ?? process.env.ORGANIZATION_NAME;
|
|
34033
|
+
this.resourcesDir = config.resourcesDir;
|
|
34001
34034
|
}
|
|
34002
34035
|
async run(udid) {
|
|
34003
34036
|
logTask(`Starting activation flow for device ${udid}`);
|
|
@@ -34054,7 +34087,7 @@ var ActivationFlow = class {
|
|
|
34054
34087
|
await removeTempFile(profilePath, "mdm profile");
|
|
34055
34088
|
}
|
|
34056
34089
|
async installTrustProfile(udid) {
|
|
34057
|
-
const resourcesProfilePath = getResourcesTrustProfilePath();
|
|
34090
|
+
const resourcesProfilePath = getResourcesTrustProfilePath(this.resourcesDir);
|
|
34058
34091
|
if ((0, import_node_fs4.existsSync)(resourcesProfilePath)) {
|
|
34059
34092
|
logTask("Installing trust profile from resources");
|
|
34060
34093
|
await this.retryIosCommand(
|
|
@@ -34072,7 +34105,7 @@ var ActivationFlow = class {
|
|
|
34072
34105
|
return;
|
|
34073
34106
|
}
|
|
34074
34107
|
logTask("Generating trust profile and saving to resources");
|
|
34075
|
-
await ensureResourcesDirExists();
|
|
34108
|
+
await ensureResourcesDirExists(this.resourcesDir);
|
|
34076
34109
|
await (0, import_promises3.writeFile)(resourcesProfilePath, trustProfile, "utf-8");
|
|
34077
34110
|
await this.retryIosCommand(
|
|
34078
34111
|
"install trust profile",
|
|
@@ -34104,13 +34137,13 @@ var ActivationFlow = class {
|
|
|
34104
34137
|
logError(`${label} failed: ${errorMsg}`);
|
|
34105
34138
|
}
|
|
34106
34139
|
logInfo(`Retrying ${label}... ${attempt + 1} of ${retries}`);
|
|
34107
|
-
await new Promise((
|
|
34140
|
+
await new Promise((resolve3) => setTimeout(resolve3, retryDelayMs));
|
|
34108
34141
|
}
|
|
34109
34142
|
throw new Error(`Failed to ${label} after ${retries} attempts`);
|
|
34110
34143
|
}
|
|
34111
34144
|
};
|
|
34112
34145
|
async function saveProfileToTemp(profile, prefix) {
|
|
34113
|
-
const tempFilePath = (0,
|
|
34146
|
+
const tempFilePath = (0, import_node_path8.join)((0, import_node_os3.tmpdir)(), `mce_${prefix}_${Date.now()}.mobileconfig`);
|
|
34114
34147
|
await (0, import_promises3.writeFile)(tempFilePath, profile, "utf-8");
|
|
34115
34148
|
logInfo(`Profile saved to: ${tempFilePath}`);
|
|
34116
34149
|
return tempFilePath;
|
|
@@ -34124,18 +34157,33 @@ async function removeTempFile(filePath, label) {
|
|
|
34124
34157
|
logError(`Failed to remove ${label} temp file: ${errorMsg}`);
|
|
34125
34158
|
}
|
|
34126
34159
|
}
|
|
34127
|
-
function getResourcesTrustProfilePath() {
|
|
34128
|
-
const
|
|
34129
|
-
|
|
34130
|
-
const packageRoot = (0, import_node_path7.join)(currentDir, "..", "..");
|
|
34131
|
-
return (0, import_node_path7.join)(packageRoot, "resources", "trust_profile.mobileconfig");
|
|
34160
|
+
function getResourcesTrustProfilePath(resourcesDir) {
|
|
34161
|
+
const resolvedResourcesDir = resolveResourcesDir(resourcesDir);
|
|
34162
|
+
return (0, import_node_path8.join)(resolvedResourcesDir, "trust_profile.mobileconfig");
|
|
34132
34163
|
}
|
|
34133
|
-
async function ensureResourcesDirExists() {
|
|
34164
|
+
async function ensureResourcesDirExists(resourcesDir) {
|
|
34165
|
+
const resolvedResourcesDir = resolveResourcesDir(resourcesDir);
|
|
34166
|
+
await (0, import_promises3.mkdir)(resolvedResourcesDir, { recursive: true });
|
|
34167
|
+
}
|
|
34168
|
+
function resolveResourcesDir(resourcesDir) {
|
|
34169
|
+
if (resourcesDir) {
|
|
34170
|
+
return (0, import_node_path8.resolve)(resourcesDir);
|
|
34171
|
+
}
|
|
34134
34172
|
const currentFile = (0, import_node_url2.fileURLToPath)(import_meta3.url);
|
|
34135
|
-
const currentDir = (0,
|
|
34136
|
-
const packageRoot = (0,
|
|
34137
|
-
|
|
34138
|
-
|
|
34173
|
+
const currentDir = (0, import_node_path8.dirname)(currentFile);
|
|
34174
|
+
const packageRoot = (0, import_node_path8.join)(currentDir, "..", "..");
|
|
34175
|
+
return (0, import_node_path8.join)(packageRoot, "resources");
|
|
34176
|
+
}
|
|
34177
|
+
function resolveIosBinaryPath(config) {
|
|
34178
|
+
if (config.iosBinaryPath) {
|
|
34179
|
+
return config.iosBinaryPath;
|
|
34180
|
+
}
|
|
34181
|
+
if (!config.resourcesDir) {
|
|
34182
|
+
return void 0;
|
|
34183
|
+
}
|
|
34184
|
+
const platform = process.platform;
|
|
34185
|
+
const binaryName = platform === "win32" ? "ios.exe" : "ios";
|
|
34186
|
+
return (0, import_node_path8.join)(resolveResourcesDir(config.resourcesDir), "ios", "bin", platform, binaryName);
|
|
34139
34187
|
}
|
|
34140
34188
|
function getActivationState2(output) {
|
|
34141
34189
|
if (!Array.isArray(output) || output.length === 0) {
|