@mcesystems/apple-kit 1.0.56 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +220 -441
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +223 -438
- package/dist/index.mjs.map +4 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic/actions/install.d.ts +2 -2
- package/dist/types/logic/actions/install.d.ts.map +1 -1
- package/dist/types/logic/actions/restore.d.ts.map +1 -1
- package/dist/types/logic/activationFlow.d.ts +2 -2
- package/dist/types/logic/activationFlow.d.ts.map +1 -1
- package/dist/types/logic/appleDeviceKit.d.ts +4 -9
- package/dist/types/logic/appleDeviceKit.d.ts.map +1 -1
- package/dist/types/logic/utils/resolvePath.d.ts +3 -3
- package/dist/types/logic/utils/resolvePath.d.ts.map +1 -1
- package/dist/types/utils/authClient.d.ts +1 -1
- package/dist/types/utils/authClient.d.ts.map +1 -1
- package/dist/types/utils/mdmClient.d.ts +1 -4
- 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/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 join8(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("(", join8(node.variableDefinitions, ", "), ")");
|
|
15036
|
+
var directives = join8(node.directives, " ");
|
|
15037
15037
|
var selectionSet = node.selectionSet;
|
|
15038
|
-
return !name && !directives && !varDefs && op === "query" ? selectionSet :
|
|
15038
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join8([op, join8([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(" ", join8(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 join8([wrap("", alias, ": ") + name + wrap("(", join8(args, ", "), ")"), join8(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(" ", join8(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 join8(["...", wrap("on ", typeCondition), join8(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("(", join8(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap("", join8(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 "[" + join8(values, ", ") + "]";
|
|
15100
15100
|
},
|
|
15101
15101
|
ObjectValue: function ObjectValue(_ref14) {
|
|
15102
15102
|
var fields = _ref14.fields;
|
|
15103
|
-
return "{" +
|
|
15103
|
+
return "{" + join8(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("(", join8(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 join8(["schema", join8(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 join8(["scalar", name, join8(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 join8(["type", name, wrap("implements ", join8(interfaces, " & ")), join8(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(join8(args, "\n")), "\n)") : wrap("(", join8(args, ", "), ")")) + ": " + type + wrap(" ", join8(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 join8([name + ": " + type, wrap("= ", defaultValue), join8(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 join8(["interface", name, join8(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 join8(["union", name, join8(directives, " "), types && types.length !== 0 ? "= " + join8(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 join8(["enum", name, join8(directives, " "), block(values)], " ");
|
|
15163
15163
|
}),
|
|
15164
15164
|
EnumValueDefinition: addDescription(function(_ref29) {
|
|
15165
15165
|
var name = _ref29.name, directives = _ref29.directives;
|
|
15166
|
-
return
|
|
15166
|
+
return join8([name, join8(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 join8(["input", name, join8(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(join8(args, "\n")), "\n)") : wrap("(", join8(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join8(locations, " | ");
|
|
15175
15175
|
}),
|
|
15176
15176
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
15177
15177
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
15178
|
-
return
|
|
15178
|
+
return join8(["extend schema", join8(directives, " "), block(operationTypes)], " ");
|
|
15179
15179
|
},
|
|
15180
15180
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
15181
15181
|
var name = _ref33.name, directives = _ref33.directives;
|
|
15182
|
-
return
|
|
15182
|
+
return join8(["extend scalar", name, join8(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 join8(["extend type", name, wrap("implements ", join8(interfaces, " & ")), join8(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 join8(["extend interface", name, join8(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 join8(["extend union", name, join8(directives, " "), types && types.length !== 0 ? "= " + join8(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 join8(["extend enum", name, join8(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 join8(["extend input", name, join8(directives, " "), block(fields)], " ");
|
|
15203
15203
|
}
|
|
15204
15204
|
};
|
|
15205
15205
|
function addDescription(cb) {
|
|
15206
15206
|
return function(node) {
|
|
15207
|
-
return
|
|
15207
|
+
return join8([node.description, cb(node)], "\n");
|
|
15208
15208
|
};
|
|
15209
15209
|
}
|
|
15210
|
-
function
|
|
15210
|
+
function join8(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(join8(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(resolve2) {
|
|
15374
15374
|
step = iterator[fn](value);
|
|
15375
|
-
|
|
15375
|
+
resolve2(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(resolve2, 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
|
+
resolve2();
|
|
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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(obj) {
|
|
15614
15614
|
return obj.name;
|
|
15615
15615
|
}
|
|
15616
15616
|
},
|
|
15617
15617
|
description: {
|
|
15618
15618
|
type: _scalars.GraphQLString,
|
|
15619
|
-
resolve: function
|
|
15619
|
+
resolve: function resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(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 resolve2(obj) {
|
|
15848
15848
|
return obj.name;
|
|
15849
15849
|
}
|
|
15850
15850
|
},
|
|
15851
15851
|
description: {
|
|
15852
15852
|
type: _scalars.GraphQLString,
|
|
15853
|
-
resolve: function
|
|
15853
|
+
resolve: function resolve2(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 resolve2(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 resolve2(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 resolve2(obj) {
|
|
15872
15872
|
return obj.isDeprecated;
|
|
15873
15873
|
}
|
|
15874
15874
|
},
|
|
15875
15875
|
deprecationReason: {
|
|
15876
15876
|
type: _scalars.GraphQLString,
|
|
15877
|
-
resolve: function
|
|
15877
|
+
resolve: function resolve2(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 resolve2(obj) {
|
|
15893
15893
|
return obj.name;
|
|
15894
15894
|
}
|
|
15895
15895
|
},
|
|
15896
15896
|
description: {
|
|
15897
15897
|
type: _scalars.GraphQLString,
|
|
15898
|
-
resolve: function
|
|
15898
|
+
resolve: function resolve2(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 resolve2(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 resolve2(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 resolve2(obj) {
|
|
15928
15928
|
return obj.name;
|
|
15929
15929
|
}
|
|
15930
15930
|
},
|
|
15931
15931
|
description: {
|
|
15932
15932
|
type: _scalars.GraphQLString,
|
|
15933
|
-
resolve: function
|
|
15933
|
+
resolve: function resolve2(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 resolve2(obj) {
|
|
15940
15940
|
return obj.isDeprecated;
|
|
15941
15941
|
}
|
|
15942
15942
|
},
|
|
15943
15943
|
deprecationReason: {
|
|
15944
15944
|
type: _scalars.GraphQLString,
|
|
15945
|
-
resolve: function
|
|
15945
|
+
resolve: function resolve2(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 resolve2(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 resolve2(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 resolve2(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(resolve2) {
|
|
20549
|
+
return resolve2(
|
|
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(resolve2) {
|
|
21400
|
+
return resolve2(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(resolve2, 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
|
+
resolve2(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(resolve2, 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
|
+
resolve2(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
|
+
resolve2(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
|
+
resolve2(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
|
+
resolve2(response);
|
|
32035
32035
|
});
|
|
32036
32036
|
raw.on("end", function() {
|
|
32037
32037
|
if (!response) {
|
|
32038
32038
|
response = new Response(body, response_options);
|
|
32039
|
-
|
|
32039
|
+
resolve2(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
|
+
resolve2(response);
|
|
32048
32048
|
return;
|
|
32049
32049
|
}
|
|
32050
32050
|
response = new Response(body, response_options);
|
|
32051
|
-
|
|
32051
|
+
resolve2(response);
|
|
32052
32052
|
});
|
|
32053
32053
|
writeToStream(req, request);
|
|
32054
32054
|
});
|
|
@@ -32121,11 +32121,7 @@ var index_exports = {};
|
|
|
32121
32121
|
__export(index_exports, {
|
|
32122
32122
|
ActivationFlow: () => ActivationFlow,
|
|
32123
32123
|
AppleDeviceKit: () => AppleDeviceKit,
|
|
32124
|
-
createIosCli: () => createIosCli
|
|
32125
|
-
ensureUsbmuxd: () => ensureUsbmuxd,
|
|
32126
|
-
isUsbmuxdRunning: () => isUsbmuxdRunning,
|
|
32127
|
-
startUsbmuxd: () => startUsbmuxd,
|
|
32128
|
-
stopUsbmuxd: () => stopUsbmuxd
|
|
32124
|
+
createIosCli: () => createIosCli
|
|
32129
32125
|
});
|
|
32130
32126
|
module.exports = __toCommonJS(index_exports);
|
|
32131
32127
|
|
|
@@ -32155,14 +32151,14 @@ var getLocalHosts = () => {
|
|
|
32155
32151
|
}
|
|
32156
32152
|
return results;
|
|
32157
32153
|
};
|
|
32158
|
-
var checkAvailablePort = (options) => new Promise((
|
|
32154
|
+
var checkAvailablePort = (options) => new Promise((resolve2, reject) => {
|
|
32159
32155
|
const server = import_node_net.default.createServer();
|
|
32160
32156
|
server.unref();
|
|
32161
32157
|
server.on("error", reject);
|
|
32162
32158
|
server.listen(options, () => {
|
|
32163
32159
|
const { port } = server.address();
|
|
32164
32160
|
server.close(() => {
|
|
32165
|
-
|
|
32161
|
+
resolve2(port);
|
|
32166
32162
|
});
|
|
32167
32163
|
});
|
|
32168
32164
|
});
|
|
@@ -32288,13 +32284,9 @@ var import_node_util = require("node:util");
|
|
|
32288
32284
|
// src/logic/utils/resolvePath.ts
|
|
32289
32285
|
var import_node_fs = require("node:fs");
|
|
32290
32286
|
var import_node_path = require("node:path");
|
|
32291
|
-
var
|
|
32292
|
-
function
|
|
32293
|
-
|
|
32294
|
-
const { fileURLToPath: fileURLToPath3 } = require("node:url");
|
|
32295
|
-
return (0, import_node_path.dirname)(fileURLToPath3(import_meta.url));
|
|
32296
|
-
}
|
|
32297
|
-
return __dirname;
|
|
32287
|
+
var resourcesDir;
|
|
32288
|
+
function setResourcesDir(dir) {
|
|
32289
|
+
resourcesDir = dir;
|
|
32298
32290
|
}
|
|
32299
32291
|
function getPlatformDir() {
|
|
32300
32292
|
const platform = process.platform;
|
|
@@ -32309,31 +32301,21 @@ function getPlatformDir() {
|
|
|
32309
32301
|
}
|
|
32310
32302
|
return platform;
|
|
32311
32303
|
}
|
|
32312
|
-
function
|
|
32313
|
-
if (
|
|
32304
|
+
function getResourcesPath() {
|
|
32305
|
+
if (resourcesDir) {
|
|
32306
|
+
return resourcesDir;
|
|
32307
|
+
}
|
|
32308
|
+
return "";
|
|
32309
|
+
}
|
|
32310
|
+
function getResourcesBinPath() {
|
|
32311
|
+
if (resourcesDir) {
|
|
32314
32312
|
const platformDir = getPlatformDir();
|
|
32315
|
-
const candidate = (0, import_node_path.join)(
|
|
32313
|
+
const candidate = (0, import_node_path.join)(resourcesDir, "ios", "bin", platformDir);
|
|
32314
|
+
console.log("candidate", candidate);
|
|
32316
32315
|
if ((0, import_node_fs.existsSync)(candidate)) {
|
|
32317
32316
|
return candidate;
|
|
32318
32317
|
}
|
|
32319
32318
|
}
|
|
32320
|
-
const envBinPath = process.env.IDeviceBinPath;
|
|
32321
|
-
if (envBinPath) {
|
|
32322
|
-
if ((0, import_node_path.isAbsolute)(envBinPath)) {
|
|
32323
|
-
return envBinPath;
|
|
32324
|
-
}
|
|
32325
|
-
const absolutePath = (0, import_node_path.join)(process.cwd(), envBinPath);
|
|
32326
|
-
logInfo(`Using absolute path: ${absolutePath}`);
|
|
32327
|
-
if ((0, import_node_fs.existsSync)(absolutePath)) {
|
|
32328
|
-
return absolutePath;
|
|
32329
|
-
}
|
|
32330
|
-
logError(`Absolute path does not exist: ${absolutePath}`);
|
|
32331
|
-
return "";
|
|
32332
|
-
}
|
|
32333
|
-
const bundledPath = getBundledResourcesPath();
|
|
32334
|
-
if (bundledPath) {
|
|
32335
|
-
return bundledPath;
|
|
32336
|
-
}
|
|
32337
32319
|
if (process.platform === "darwin") {
|
|
32338
32320
|
const homebrewArmPath = "/opt/homebrew/bin";
|
|
32339
32321
|
if ((0, import_node_fs.existsSync)((0, import_node_path.join)(homebrewArmPath, "idevice_id"))) {
|
|
@@ -32354,25 +32336,6 @@ function getResourcesBinPath(options) {
|
|
|
32354
32336
|
}
|
|
32355
32337
|
return "";
|
|
32356
32338
|
}
|
|
32357
|
-
function getBundledResourcesPath() {
|
|
32358
|
-
const moduleDir = getModuleDir();
|
|
32359
|
-
let packageRoot;
|
|
32360
|
-
if (moduleDir.includes("dist")) {
|
|
32361
|
-
packageRoot = (0, import_node_path.join)(moduleDir, "..", "..");
|
|
32362
|
-
} else {
|
|
32363
|
-
packageRoot = (0, import_node_path.join)(moduleDir, "..", "..", "..", "..");
|
|
32364
|
-
}
|
|
32365
|
-
const platformDir = getPlatformDir();
|
|
32366
|
-
const distPath = (0, import_node_path.join)(packageRoot, "dist", "resources", "bin", platformDir);
|
|
32367
|
-
if ((0, import_node_fs.existsSync)((0, import_node_path.join)(distPath, "idevice_id")) || (0, import_node_fs.existsSync)((0, import_node_path.join)(distPath, "idevice_id.exe"))) {
|
|
32368
|
-
return distPath;
|
|
32369
|
-
}
|
|
32370
|
-
const devPath = (0, import_node_path.join)(packageRoot, "resources", "bin", platformDir);
|
|
32371
|
-
if ((0, import_node_fs.existsSync)((0, import_node_path.join)(devPath, "idevice_id")) || (0, import_node_fs.existsSync)((0, import_node_path.join)(devPath, "idevice_id.exe"))) {
|
|
32372
|
-
return devPath;
|
|
32373
|
-
}
|
|
32374
|
-
return null;
|
|
32375
|
-
}
|
|
32376
32339
|
|
|
32377
32340
|
// src/logic/actions/tool.ts
|
|
32378
32341
|
var execAsync = (0, import_node_util.promisify)(import_node_child_process.exec);
|
|
@@ -32425,131 +32388,6 @@ async function getActivationState(udid) {
|
|
|
32425
32388
|
}
|
|
32426
32389
|
}
|
|
32427
32390
|
|
|
32428
|
-
// src/logic/actions/pair.ts
|
|
32429
|
-
async function isPaired(udid) {
|
|
32430
|
-
logTask(`Checking pairing status for ${udid}`);
|
|
32431
|
-
try {
|
|
32432
|
-
const result = await runIDeviceTool("idevicepair", ["-u", udid, "validate"]);
|
|
32433
|
-
if (!result) {
|
|
32434
|
-
return false;
|
|
32435
|
-
}
|
|
32436
|
-
return result.stdout.toLowerCase().includes("success");
|
|
32437
|
-
} catch {
|
|
32438
|
-
return false;
|
|
32439
|
-
}
|
|
32440
|
-
}
|
|
32441
|
-
async function trustDevice(udid, timeout2 = 6e4, onWaitingForTrust) {
|
|
32442
|
-
logTask(`Trusting device ${udid}`);
|
|
32443
|
-
if (await isPaired(udid)) {
|
|
32444
|
-
logInfo(`Device ${udid} is already trusted`);
|
|
32445
|
-
return true;
|
|
32446
|
-
}
|
|
32447
|
-
logInfo(`Initiating pairing for device ${udid}`);
|
|
32448
|
-
try {
|
|
32449
|
-
const pairResult = await pair(udid);
|
|
32450
|
-
if (pairResult) {
|
|
32451
|
-
logInfo(`Device ${udid} paired successfully`);
|
|
32452
|
-
return true;
|
|
32453
|
-
}
|
|
32454
|
-
} catch (error) {
|
|
32455
|
-
logError(`Pairing failed with ${udid}: ${error}`);
|
|
32456
|
-
}
|
|
32457
|
-
logInfo("Please accept the trust dialog on the device...");
|
|
32458
|
-
onWaitingForTrust?.();
|
|
32459
|
-
try {
|
|
32460
|
-
await waitForPairing(udid, timeout2, 1e3);
|
|
32461
|
-
logInfo(`Device ${udid} is now trusted`);
|
|
32462
|
-
return true;
|
|
32463
|
-
} catch {
|
|
32464
|
-
logInfo(`Timeout waiting for trust acceptance on device ${udid}`);
|
|
32465
|
-
return false;
|
|
32466
|
-
}
|
|
32467
|
-
}
|
|
32468
|
-
async function waitForPairing(udid, timeout2 = 12e4, pollInterval = 1e3) {
|
|
32469
|
-
logTask(`Waiting for pairing on device ${udid}`);
|
|
32470
|
-
const startTime = Date.now();
|
|
32471
|
-
while (Date.now() - startTime < timeout2) {
|
|
32472
|
-
if (await isPaired(udid)) {
|
|
32473
|
-
logInfo(`Device ${udid} is now paired`);
|
|
32474
|
-
return true;
|
|
32475
|
-
}
|
|
32476
|
-
await new Promise((resolve5) => setTimeout(resolve5, pollInterval));
|
|
32477
|
-
}
|
|
32478
|
-
throw new Error(`Timeout waiting for device pairing after ${timeout2}ms`);
|
|
32479
|
-
}
|
|
32480
|
-
async function pair(udid) {
|
|
32481
|
-
logTask(`Initiating pairing for device ${udid}`);
|
|
32482
|
-
try {
|
|
32483
|
-
const result = await runIDeviceTool("idevicepair", ["-u", udid, "pair"]);
|
|
32484
|
-
if (!result) {
|
|
32485
|
-
return false;
|
|
32486
|
-
}
|
|
32487
|
-
return result.stdout.toLowerCase().includes("success");
|
|
32488
|
-
} catch (error) {
|
|
32489
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
32490
|
-
if (errorMsg.includes("Please accept the trust dialog")) {
|
|
32491
|
-
return false;
|
|
32492
|
-
}
|
|
32493
|
-
throw error;
|
|
32494
|
-
}
|
|
32495
|
-
}
|
|
32496
|
-
async function unpair(udid) {
|
|
32497
|
-
logTask(`Un-pairing device ${udid}`);
|
|
32498
|
-
try {
|
|
32499
|
-
const result = await runIDeviceTool("idevicepair", ["-u", udid, "unpair"]);
|
|
32500
|
-
if (!result) {
|
|
32501
|
-
return false;
|
|
32502
|
-
}
|
|
32503
|
-
return result.stdout.toLowerCase().includes("success");
|
|
32504
|
-
} catch {
|
|
32505
|
-
return false;
|
|
32506
|
-
}
|
|
32507
|
-
}
|
|
32508
|
-
|
|
32509
|
-
// src/logic/actions/appState.ts
|
|
32510
|
-
var FRONTMOST_KEYS = [
|
|
32511
|
-
"FrontmostApplicationBundleID",
|
|
32512
|
-
"FrontmostApplicationBundleId",
|
|
32513
|
-
"FrontmostAppBundleIdentifier",
|
|
32514
|
-
"ForegroundApplicationBundleID",
|
|
32515
|
-
"ForegroundApplicationBundleId",
|
|
32516
|
-
"ForegroundAppBundleId",
|
|
32517
|
-
"ApplicationBundleIdentifier",
|
|
32518
|
-
"BundleIdentifier",
|
|
32519
|
-
"bundleIdentifier",
|
|
32520
|
-
"bundleId"
|
|
32521
|
-
];
|
|
32522
|
-
async function isAppOpened(bundleId, udid) {
|
|
32523
|
-
logTask(`Checking if app ${bundleId} is opened on device ${udid}`);
|
|
32524
|
-
if (!await isPaired(udid)) {
|
|
32525
|
-
await waitForPairing(udid, 1e4);
|
|
32526
|
-
}
|
|
32527
|
-
try {
|
|
32528
|
-
for (const key of FRONTMOST_KEYS) {
|
|
32529
|
-
const result = await runIDeviceTool("ideviceinfo", ["-u", udid, "-k", key]);
|
|
32530
|
-
const output = result?.stdout?.trim() ?? "";
|
|
32531
|
-
if (!output) {
|
|
32532
|
-
continue;
|
|
32533
|
-
}
|
|
32534
|
-
if (isBundleIdMatch(output, bundleId)) {
|
|
32535
|
-
return true;
|
|
32536
|
-
}
|
|
32537
|
-
}
|
|
32538
|
-
} catch (error) {
|
|
32539
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
32540
|
-
logInfo(`isAppOpened failed: ${errorMsg}`);
|
|
32541
|
-
}
|
|
32542
|
-
return false;
|
|
32543
|
-
}
|
|
32544
|
-
function isBundleIdMatch(value, bundleId) {
|
|
32545
|
-
if (value === bundleId) {
|
|
32546
|
-
return true;
|
|
32547
|
-
}
|
|
32548
|
-
const escaped = bundleId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
32549
|
-
const matcher = new RegExp(`(^|[^A-Za-z0-9_.-])${escaped}($|[^A-Za-z0-9_.-])`);
|
|
32550
|
-
return matcher.test(value);
|
|
32551
|
-
}
|
|
32552
|
-
|
|
32553
32391
|
// src/logic/actions/device.ts
|
|
32554
32392
|
var import_node_fs2 = require("node:fs");
|
|
32555
32393
|
var import_node_path3 = require("node:path");
|
|
@@ -32869,22 +32707,22 @@ var GraphQLWebSocketClient = class {
|
|
|
32869
32707
|
};
|
|
32870
32708
|
}
|
|
32871
32709
|
rawRequest(query, variables) {
|
|
32872
|
-
return new Promise((
|
|
32710
|
+
return new Promise((resolve2, reject) => {
|
|
32873
32711
|
let result;
|
|
32874
32712
|
this.rawSubscribe(query, {
|
|
32875
32713
|
next: (data, extensions) => result = { data, extensions },
|
|
32876
32714
|
error: reject,
|
|
32877
|
-
complete: () =>
|
|
32715
|
+
complete: () => resolve2(result)
|
|
32878
32716
|
}, variables);
|
|
32879
32717
|
});
|
|
32880
32718
|
}
|
|
32881
32719
|
request(document2, variables) {
|
|
32882
|
-
return new Promise((
|
|
32720
|
+
return new Promise((resolve2, reject) => {
|
|
32883
32721
|
let result;
|
|
32884
32722
|
this.subscribe(document2, {
|
|
32885
32723
|
next: (data) => result = data,
|
|
32886
32724
|
error: reject,
|
|
32887
|
-
complete: () =>
|
|
32725
|
+
complete: () => resolve2(result)
|
|
32888
32726
|
}, variables);
|
|
32889
32727
|
});
|
|
32890
32728
|
}
|
|
@@ -33310,13 +33148,8 @@ async function getAuthToken(credentials, apiUrl) {
|
|
|
33310
33148
|
}
|
|
33311
33149
|
async function readCredentialsFromFile(filePath) {
|
|
33312
33150
|
const fs = await import("node:fs/promises");
|
|
33313
|
-
|
|
33314
|
-
const
|
|
33315
|
-
if (!credentialsPath) {
|
|
33316
|
-
throw new Error("Credential file path is required. Set MDM_CRED_PATH or APP_CRED_PATH.");
|
|
33317
|
-
}
|
|
33318
|
-
logInfo(`Reading credentials from: ${credentialsPath}`);
|
|
33319
|
-
const content = await fs.readFile(credentialsPath, "utf-8");
|
|
33151
|
+
logInfo(`Reading credentials from: ${filePath}`);
|
|
33152
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
33320
33153
|
const credentials = JSON.parse(content);
|
|
33321
33154
|
if (!credentials.clientDecorator || !credentials.variantConfigurationKey) {
|
|
33322
33155
|
throw new Error("Invalid credentials file: missing clientDecorator or variantConfigurationKey");
|
|
@@ -33388,9 +33221,9 @@ function createMdmClient(config) {
|
|
|
33388
33221
|
}
|
|
33389
33222
|
};
|
|
33390
33223
|
}
|
|
33391
|
-
async function
|
|
33224
|
+
async function createMDMClient() {
|
|
33392
33225
|
const endpoint = process.env.MDM_ENDPOINT;
|
|
33393
|
-
const credPath =
|
|
33226
|
+
const credPath = (0, import_node_path4.join)(getResourcesPath(), "@clientLocal.json");
|
|
33394
33227
|
if (!endpoint || !credPath) {
|
|
33395
33228
|
return void 0;
|
|
33396
33229
|
}
|
|
@@ -33402,55 +33235,100 @@ async function createMdmClientFromEnv(options) {
|
|
|
33402
33235
|
timeout: 6e4
|
|
33403
33236
|
});
|
|
33404
33237
|
}
|
|
33405
|
-
function resolveCredentialsPath(options) {
|
|
33406
|
-
if (options?.credentialsPath) {
|
|
33407
|
-
return (0, import_node_path4.resolve)(options.credentialsPath);
|
|
33408
|
-
}
|
|
33409
|
-
if (options?.resourcesDir) {
|
|
33410
|
-
return (0, import_node_path4.join)((0, import_node_path4.resolve)(options.resourcesDir), "@clientLocal.json");
|
|
33411
|
-
}
|
|
33412
|
-
return process.env.MDM_CRED_PATH ?? process.env.APP_CRED_PATH;
|
|
33413
|
-
}
|
|
33414
33238
|
|
|
33415
|
-
// src/logic/actions/
|
|
33416
|
-
async function
|
|
33417
|
-
logTask(`
|
|
33418
|
-
|
|
33419
|
-
|
|
33420
|
-
|
|
33421
|
-
|
|
33422
|
-
|
|
33423
|
-
|
|
33424
|
-
|
|
33425
|
-
|
|
33239
|
+
// src/logic/actions/pair.ts
|
|
33240
|
+
async function isPaired(udid) {
|
|
33241
|
+
logTask(`Checking pairing status for ${udid}`);
|
|
33242
|
+
try {
|
|
33243
|
+
const result = await runIDeviceTool("idevicepair", ["-u", udid, "validate"]);
|
|
33244
|
+
if (!result) {
|
|
33245
|
+
return false;
|
|
33246
|
+
}
|
|
33247
|
+
return result.stdout.toLowerCase().includes("success");
|
|
33248
|
+
} catch {
|
|
33249
|
+
return false;
|
|
33426
33250
|
}
|
|
33427
|
-
return {
|
|
33428
|
-
appId,
|
|
33429
|
-
url,
|
|
33430
|
-
waitForInstalled
|
|
33431
|
-
};
|
|
33432
33251
|
}
|
|
33433
|
-
function
|
|
33434
|
-
|
|
33435
|
-
|
|
33252
|
+
async function trustDevice(udid, timeout2 = 6e4, onWaitingForTrust) {
|
|
33253
|
+
logTask(`Trusting device ${udid}`);
|
|
33254
|
+
if (await isPaired(udid)) {
|
|
33255
|
+
logInfo(`Device ${udid} is already trusted`);
|
|
33256
|
+
return true;
|
|
33257
|
+
}
|
|
33258
|
+
logInfo(`Initiating pairing for device ${udid}`);
|
|
33259
|
+
try {
|
|
33260
|
+
const pairResult = await pair(udid);
|
|
33261
|
+
if (pairResult) {
|
|
33262
|
+
logInfo(`Device ${udid} paired successfully`);
|
|
33263
|
+
return true;
|
|
33264
|
+
}
|
|
33265
|
+
} catch (error) {
|
|
33266
|
+
logError(`Pairing failed with ${udid}: ${error}`);
|
|
33436
33267
|
}
|
|
33437
|
-
|
|
33438
|
-
|
|
33268
|
+
logInfo("Please accept the trust dialog on the device...");
|
|
33269
|
+
onWaitingForTrust?.();
|
|
33270
|
+
try {
|
|
33271
|
+
await waitForPairing(udid, timeout2, 1e3);
|
|
33272
|
+
logInfo(`Device ${udid} is now trusted`);
|
|
33439
33273
|
return true;
|
|
33274
|
+
} catch {
|
|
33275
|
+
logInfo(`Timeout waiting for trust acceptance on device ${udid}`);
|
|
33276
|
+
return false;
|
|
33277
|
+
}
|
|
33278
|
+
}
|
|
33279
|
+
async function waitForPairing(udid, timeout2 = 12e4, pollInterval = 1e3) {
|
|
33280
|
+
logTask(`Waiting for pairing on device ${udid}`);
|
|
33281
|
+
const startTime = Date.now();
|
|
33282
|
+
while (Date.now() - startTime < timeout2) {
|
|
33283
|
+
if (await isPaired(udid)) {
|
|
33284
|
+
logInfo(`Device ${udid} is now paired`);
|
|
33285
|
+
return true;
|
|
33286
|
+
}
|
|
33287
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
33288
|
+
}
|
|
33289
|
+
throw new Error(`Timeout waiting for device pairing after ${timeout2}ms`);
|
|
33290
|
+
}
|
|
33291
|
+
async function pair(udid) {
|
|
33292
|
+
logTask(`Initiating pairing for device ${udid}`);
|
|
33293
|
+
try {
|
|
33294
|
+
const result = await runIDeviceTool("idevicepair", ["-u", udid, "pair"]);
|
|
33295
|
+
if (!result) {
|
|
33296
|
+
return false;
|
|
33297
|
+
}
|
|
33298
|
+
return result.stdout.toLowerCase().includes("success");
|
|
33299
|
+
} catch (error) {
|
|
33300
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
33301
|
+
if (errorMsg.includes("Please accept the trust dialog")) {
|
|
33302
|
+
return false;
|
|
33303
|
+
}
|
|
33304
|
+
throw error;
|
|
33440
33305
|
}
|
|
33441
|
-
|
|
33306
|
+
}
|
|
33307
|
+
async function unpair(udid) {
|
|
33308
|
+
logTask(`Un-pairing device ${udid}`);
|
|
33309
|
+
try {
|
|
33310
|
+
const result = await runIDeviceTool("idevicepair", ["-u", udid, "unpair"]);
|
|
33311
|
+
if (!result) {
|
|
33312
|
+
return false;
|
|
33313
|
+
}
|
|
33314
|
+
return result.stdout.toLowerCase().includes("success");
|
|
33315
|
+
} catch {
|
|
33442
33316
|
return false;
|
|
33443
33317
|
}
|
|
33444
|
-
return void 0;
|
|
33445
33318
|
}
|
|
33446
|
-
|
|
33319
|
+
|
|
33320
|
+
// src/logic/actions/install.ts
|
|
33321
|
+
async function installLocalApp(ipaPath, udid) {
|
|
33322
|
+
logTask(`Installing app ${ipaPath} on device ${udid}`);
|
|
33323
|
+
await runIDeviceTool("ideviceinstaller", ["-u", udid, "install", ipaPath]);
|
|
33324
|
+
}
|
|
33325
|
+
async function installManagedApp(ipaPath, udid, timeBetweenInstalls, options) {
|
|
33447
33326
|
await installLocalApp(ipaPath, udid);
|
|
33448
|
-
const
|
|
33449
|
-
const client = await createMdmClientFromEnv();
|
|
33327
|
+
const client = await createMDMClient();
|
|
33450
33328
|
logTask("Installing app via MDM for management takeover");
|
|
33451
|
-
await new Promise((
|
|
33329
|
+
await new Promise((resolve2) => setTimeout(resolve2, timeBetweenInstalls));
|
|
33452
33330
|
if (client) {
|
|
33453
|
-
client.installApp(udid,
|
|
33331
|
+
client.installApp(udid, options);
|
|
33454
33332
|
}
|
|
33455
33333
|
}
|
|
33456
33334
|
async function uninstallApp(bundleId, udid) {
|
|
@@ -33493,7 +33371,7 @@ async function wakeDevice(udid) {
|
|
|
33493
33371
|
await runIDeviceTool("idevicepair", ["-u", udid, "validate"]);
|
|
33494
33372
|
} catch {
|
|
33495
33373
|
}
|
|
33496
|
-
await new Promise((
|
|
33374
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
33497
33375
|
logInfo("Device wake attempt completed");
|
|
33498
33376
|
} catch (error) {
|
|
33499
33377
|
logInfo(
|
|
@@ -33525,7 +33403,7 @@ async function launchApp(bundleId, args, udid) {
|
|
|
33525
33403
|
throw new Error("debugserver_not_available");
|
|
33526
33404
|
}
|
|
33527
33405
|
logInfo(`App ${bundleId} launched successfully using idevicedebug`);
|
|
33528
|
-
await new Promise((
|
|
33406
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
33529
33407
|
return;
|
|
33530
33408
|
} catch (error) {
|
|
33531
33409
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
@@ -33608,7 +33486,7 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33608
33486
|
);
|
|
33609
33487
|
}
|
|
33610
33488
|
logInfo(`App ${bundleId} launched successfully using pymobiledevice3 with tunnel`);
|
|
33611
|
-
await new Promise((
|
|
33489
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
33612
33490
|
return;
|
|
33613
33491
|
} catch {
|
|
33614
33492
|
throw new Error(
|
|
@@ -33625,7 +33503,7 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33625
33503
|
logInfo(`Warning: pymobiledevice3 reported errors: ${output.substring(0, 300)}`);
|
|
33626
33504
|
}
|
|
33627
33505
|
logInfo(`App ${bundleId} launched successfully using pymobiledevice3`);
|
|
33628
|
-
await new Promise((
|
|
33506
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
33629
33507
|
} catch (error) {
|
|
33630
33508
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
33631
33509
|
if (errorMsg.includes("not found") || errorMsg.includes("command not found") || errorMsg.includes("cannot find") || errorMsg.includes("No module named")) {
|
|
@@ -33641,7 +33519,7 @@ async function launchAppWithPymobiledevice3(bundleId, args, udid) {
|
|
|
33641
33519
|
var import_node_child_process2 = require("node:child_process");
|
|
33642
33520
|
var import_node_path5 = require("node:path");
|
|
33643
33521
|
function startPortForward(localPort, devicePort, udid, startupTimeout = 500) {
|
|
33644
|
-
return new Promise((
|
|
33522
|
+
return new Promise((resolve2, reject) => {
|
|
33645
33523
|
logTask(`Starting port forward ${localPort} -> ${devicePort} for device ${udid}`);
|
|
33646
33524
|
const binPath = getResourcesBinPath();
|
|
33647
33525
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
@@ -33694,7 +33572,7 @@ function startPortForward(localPort, devicePort, udid, startupTimeout = 500) {
|
|
|
33694
33572
|
if (!hasResolved) {
|
|
33695
33573
|
hasResolved = true;
|
|
33696
33574
|
logTask(`Port forward started: ${localPort} -> ${devicePort} for device ${udid}`);
|
|
33697
|
-
|
|
33575
|
+
resolve2({
|
|
33698
33576
|
result: {
|
|
33699
33577
|
localPort,
|
|
33700
33578
|
devicePort
|
|
@@ -33716,7 +33594,6 @@ function killPortForwardProcess(process2) {
|
|
|
33716
33594
|
var import_promises2 = require("node:fs/promises");
|
|
33717
33595
|
var import_node_os2 = require("node:os");
|
|
33718
33596
|
var import_node_path7 = require("node:path");
|
|
33719
|
-
var import_node_url2 = require("node:url");
|
|
33720
33597
|
|
|
33721
33598
|
// src/utils/wifiProfile.ts
|
|
33722
33599
|
var import_node_crypto2 = require("node:crypto");
|
|
@@ -33726,10 +33603,10 @@ var import_node_fs3 = require("node:fs");
|
|
|
33726
33603
|
var import_promises = require("node:fs/promises");
|
|
33727
33604
|
var import_node_path6 = require("node:path");
|
|
33728
33605
|
var import_node_url = require("node:url");
|
|
33729
|
-
var
|
|
33606
|
+
var import_meta = {};
|
|
33730
33607
|
function resolveEnvPlistDir() {
|
|
33731
|
-
const envPath =
|
|
33732
|
-
if (!envPath) {
|
|
33608
|
+
const envPath = (0, import_node_path6.join)(getResourcesPath(), "plist");
|
|
33609
|
+
if (!(0, import_node_fs3.existsSync)(envPath)) {
|
|
33733
33610
|
return null;
|
|
33734
33611
|
}
|
|
33735
33612
|
const absolutePath = (0, import_node_path6.isAbsolute)(envPath) ? envPath : (0, import_node_path6.join)(process.cwd(), envPath);
|
|
@@ -33748,8 +33625,8 @@ function getPlistDir(overrideDir) {
|
|
|
33748
33625
|
}
|
|
33749
33626
|
let baseDir;
|
|
33750
33627
|
try {
|
|
33751
|
-
if (typeof
|
|
33752
|
-
const currentFile = (0, import_node_url.fileURLToPath)(
|
|
33628
|
+
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
33629
|
+
const currentFile = (0, import_node_url.fileURLToPath)(import_meta.url);
|
|
33753
33630
|
baseDir = (0, import_node_path6.dirname)(currentFile);
|
|
33754
33631
|
} else {
|
|
33755
33632
|
baseDir = typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
@@ -33936,7 +33813,7 @@ function parseWifiEapType(value) {
|
|
|
33936
33813
|
// src/logic/iosCli.ts
|
|
33937
33814
|
var import_node_child_process3 = require("node:child_process");
|
|
33938
33815
|
function runIosCommand(iosBinaryPath, args) {
|
|
33939
|
-
return new Promise((
|
|
33816
|
+
return new Promise((resolve2, reject) => {
|
|
33940
33817
|
const child = (0, import_node_child_process3.spawn)(iosBinaryPath, args, {
|
|
33941
33818
|
windowsHide: true,
|
|
33942
33819
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -33962,7 +33839,7 @@ function runIosCommand(iosBinaryPath, args) {
|
|
|
33962
33839
|
msg: lineJson.msg,
|
|
33963
33840
|
timestamp: lineJson.timestamp
|
|
33964
33841
|
}));
|
|
33965
|
-
|
|
33842
|
+
resolve2({
|
|
33966
33843
|
command: iosBinaryPath,
|
|
33967
33844
|
args,
|
|
33968
33845
|
output,
|
|
@@ -34123,20 +34000,19 @@ function createIosCli(iosBinaryPath) {
|
|
|
34123
34000
|
}
|
|
34124
34001
|
|
|
34125
34002
|
// src/logic/activationFlow.ts
|
|
34126
|
-
var import_meta3 = {};
|
|
34127
34003
|
var DEFAULT_RETRIES = 150;
|
|
34128
34004
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
34129
34005
|
var MCE_MDM_PROFILE_PREFIX = "com.mce.mdm";
|
|
34130
34006
|
var ActivationFlow = class {
|
|
34131
34007
|
iosCli;
|
|
34132
34008
|
mdmClientPromise;
|
|
34133
|
-
constructor(
|
|
34134
|
-
const iosBinaryPath = resolveIosBinaryPath(
|
|
34009
|
+
constructor() {
|
|
34010
|
+
const iosBinaryPath = resolveIosBinaryPath();
|
|
34135
34011
|
if (!iosBinaryPath) {
|
|
34136
34012
|
throw new Error("iosBinaryPath is required. Provide iosBinaryPath or resourcesDir.");
|
|
34137
34013
|
}
|
|
34138
34014
|
this.iosCli = createIosCli(iosBinaryPath);
|
|
34139
|
-
this.mdmClientPromise =
|
|
34015
|
+
this.mdmClientPromise = createMDMClient();
|
|
34140
34016
|
}
|
|
34141
34017
|
async run(udid) {
|
|
34142
34018
|
logTask(`Starting activation flow for device ${udid}`);
|
|
@@ -34225,7 +34101,7 @@ var ActivationFlow = class {
|
|
|
34225
34101
|
async requireMdmClient() {
|
|
34226
34102
|
const client = await this.mdmClientPromise;
|
|
34227
34103
|
if (!client) {
|
|
34228
|
-
throw new Error("MDM client not configured. Set
|
|
34104
|
+
throw new Error("MDM client not configured. Set mdm endpoint and credential path.");
|
|
34229
34105
|
}
|
|
34230
34106
|
return client;
|
|
34231
34107
|
}
|
|
@@ -34247,7 +34123,7 @@ var ActivationFlow = class {
|
|
|
34247
34123
|
logError(`${label} failed: ${errorMsg}`);
|
|
34248
34124
|
}
|
|
34249
34125
|
logInfo(`Retrying ${label}... ${attempt + 1} of ${retries}`);
|
|
34250
|
-
await new Promise((
|
|
34126
|
+
await new Promise((resolve2) => setTimeout(resolve2, retryDelayMs));
|
|
34251
34127
|
}
|
|
34252
34128
|
throw new Error(`Failed to ${label} after ${retries} attempts`);
|
|
34253
34129
|
}
|
|
@@ -34280,25 +34156,10 @@ function getProfileIdentifierFromProfile(profile) {
|
|
|
34280
34156
|
}
|
|
34281
34157
|
return matches[matches.length - 1];
|
|
34282
34158
|
}
|
|
34283
|
-
function
|
|
34284
|
-
if (resourcesDir) {
|
|
34285
|
-
return (0, import_node_path7.resolve)(resourcesDir);
|
|
34286
|
-
}
|
|
34287
|
-
const currentFile = (0, import_node_url2.fileURLToPath)(import_meta3.url);
|
|
34288
|
-
const currentDir = (0, import_node_path7.dirname)(currentFile);
|
|
34289
|
-
const packageRoot = (0, import_node_path7.join)(currentDir, "..", "..");
|
|
34290
|
-
return (0, import_node_path7.join)(packageRoot, "resources");
|
|
34291
|
-
}
|
|
34292
|
-
function resolveIosBinaryPath(config) {
|
|
34293
|
-
if (config.iosBinaryPath) {
|
|
34294
|
-
return config.iosBinaryPath;
|
|
34295
|
-
}
|
|
34296
|
-
if (!config.resourcesDir) {
|
|
34297
|
-
return void 0;
|
|
34298
|
-
}
|
|
34159
|
+
function resolveIosBinaryPath() {
|
|
34299
34160
|
const platform = process.platform;
|
|
34300
34161
|
const binaryName = platform === "win32" ? "ios.exe" : "ios";
|
|
34301
|
-
return (0, import_node_path7.join)(
|
|
34162
|
+
return (0, import_node_path7.join)(getResourcesBinPath(), binaryName);
|
|
34302
34163
|
}
|
|
34303
34164
|
function getActivationState2(output) {
|
|
34304
34165
|
if (!Array.isArray(output) || output.length === 0) {
|
|
@@ -34356,6 +34217,9 @@ var AppleDeviceKit = class {
|
|
|
34356
34217
|
proxyProcess = null;
|
|
34357
34218
|
localDevicePort = null;
|
|
34358
34219
|
isDisposed = false;
|
|
34220
|
+
static setResourcesDir(dir) {
|
|
34221
|
+
setResourcesDir(dir);
|
|
34222
|
+
}
|
|
34359
34223
|
/**
|
|
34360
34224
|
* Throws if the kit has been disposed
|
|
34361
34225
|
*/
|
|
@@ -34426,9 +34290,9 @@ var AppleDeviceKit = class {
|
|
|
34426
34290
|
*
|
|
34427
34291
|
* @param ipaPath Path to the IPA file
|
|
34428
34292
|
*/
|
|
34429
|
-
async installApp(ipaPath, timeBetweenInstalls = 1e4) {
|
|
34293
|
+
async installApp(ipaPath, options, timeBetweenInstalls = 1e4) {
|
|
34430
34294
|
this.ensureNotDisposed();
|
|
34431
|
-
return installManagedApp(ipaPath, this.deviceId, timeBetweenInstalls);
|
|
34295
|
+
return installManagedApp(ipaPath, this.deviceId, timeBetweenInstalls, options);
|
|
34432
34296
|
}
|
|
34433
34297
|
/**
|
|
34434
34298
|
* Uninstall an app by bundle ID (uninstall agent)
|
|
@@ -34448,15 +34312,6 @@ var AppleDeviceKit = class {
|
|
|
34448
34312
|
this.ensureNotDisposed();
|
|
34449
34313
|
return isAppInstalled(bundleId, this.deviceId);
|
|
34450
34314
|
}
|
|
34451
|
-
/**
|
|
34452
|
-
* Check if an app is currently opened on the device
|
|
34453
|
-
*
|
|
34454
|
-
* @param bundleId Application bundle identifier
|
|
34455
|
-
*/
|
|
34456
|
-
async isAppOpened(bundleId) {
|
|
34457
|
-
this.ensureNotDisposed();
|
|
34458
|
-
return isAppOpened(bundleId, this.deviceId);
|
|
34459
|
-
}
|
|
34460
34315
|
/**
|
|
34461
34316
|
* List all installed user applications
|
|
34462
34317
|
*/
|
|
@@ -34535,9 +34390,9 @@ var AppleDeviceKit = class {
|
|
|
34535
34390
|
*
|
|
34536
34391
|
* Precondition: the device must be paired and trusted.
|
|
34537
34392
|
*/
|
|
34538
|
-
async activate(
|
|
34393
|
+
async activate() {
|
|
34539
34394
|
this.ensureNotDisposed();
|
|
34540
|
-
const flow = new ActivationFlow(
|
|
34395
|
+
const flow = new ActivationFlow();
|
|
34541
34396
|
return await flow.run(this.deviceId);
|
|
34542
34397
|
}
|
|
34543
34398
|
/**
|
|
@@ -34592,87 +34447,11 @@ var AppleDeviceKit = class {
|
|
|
34592
34447
|
this.dispose();
|
|
34593
34448
|
}
|
|
34594
34449
|
};
|
|
34595
|
-
|
|
34596
|
-
// src/logic/actions/usbmuxd.ts
|
|
34597
|
-
var import_node_child_process4 = require("node:child_process");
|
|
34598
|
-
var import_node_path8 = require("node:path");
|
|
34599
|
-
var usbmuxdProcess = null;
|
|
34600
|
-
function startUsbmuxd(foreground = false, options) {
|
|
34601
|
-
const current = usbmuxdProcess;
|
|
34602
|
-
if (current && isProcessRunning(current)) {
|
|
34603
|
-
logInfo("usbmuxd is already running");
|
|
34604
|
-
return current;
|
|
34605
|
-
}
|
|
34606
|
-
const binPath = getResourcesBinPath({ resourcesDir: options?.resourcesDir });
|
|
34607
|
-
const ext = process.platform === "win32" ? ".exe" : "";
|
|
34608
|
-
const toolPath = binPath ? (0, import_node_path8.join)(binPath, `usbmuxd${ext}`) : `usbmuxd${ext}`;
|
|
34609
|
-
const args = foreground ? ["-f"] : [];
|
|
34610
|
-
const spawnOptions = {
|
|
34611
|
-
windowsHide: true,
|
|
34612
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
34613
|
-
};
|
|
34614
|
-
if (binPath) {
|
|
34615
|
-
spawnOptions.cwd = binPath;
|
|
34616
|
-
}
|
|
34617
|
-
if (!foreground) {
|
|
34618
|
-
spawnOptions.detached = true;
|
|
34619
|
-
}
|
|
34620
|
-
logTask(`Starting usbmuxd with path: ${toolPath}`);
|
|
34621
|
-
const child = (0, import_node_child_process4.spawn)(toolPath, args, spawnOptions);
|
|
34622
|
-
usbmuxdProcess = child;
|
|
34623
|
-
child.stdout?.on("data", (data) => {
|
|
34624
|
-
logInfo(data.toString());
|
|
34625
|
-
});
|
|
34626
|
-
child.stderr?.on("data", (data) => {
|
|
34627
|
-
logError(data.toString());
|
|
34628
|
-
});
|
|
34629
|
-
child.on("error", (error) => {
|
|
34630
|
-
logError(`usbmuxd failed to start: ${error.message}`);
|
|
34631
|
-
});
|
|
34632
|
-
child.on("exit", (code) => {
|
|
34633
|
-
if (usbmuxdProcess === child) {
|
|
34634
|
-
usbmuxdProcess = null;
|
|
34635
|
-
}
|
|
34636
|
-
logInfo(`usbmuxd exited with code ${code ?? "unknown"}`);
|
|
34637
|
-
});
|
|
34638
|
-
return child;
|
|
34639
|
-
}
|
|
34640
|
-
function stopUsbmuxd() {
|
|
34641
|
-
const current = usbmuxdProcess;
|
|
34642
|
-
if (!current || !isProcessRunning(current)) {
|
|
34643
|
-
logInfo("usbmuxd is not running");
|
|
34644
|
-
return;
|
|
34645
|
-
}
|
|
34646
|
-
logTask("Stopping usbmuxd");
|
|
34647
|
-
current.kill();
|
|
34648
|
-
usbmuxdProcess = null;
|
|
34649
|
-
}
|
|
34650
|
-
function isUsbmuxdRunning() {
|
|
34651
|
-
const current = usbmuxdProcess;
|
|
34652
|
-
return Boolean(current && isProcessRunning(current));
|
|
34653
|
-
}
|
|
34654
|
-
function ensureUsbmuxd(foreground = false, options) {
|
|
34655
|
-
const current = usbmuxdProcess;
|
|
34656
|
-
if (current && isProcessRunning(current)) {
|
|
34657
|
-
return current;
|
|
34658
|
-
}
|
|
34659
|
-
return startUsbmuxd(foreground, options);
|
|
34660
|
-
}
|
|
34661
|
-
function isProcessRunning(process2) {
|
|
34662
|
-
if (process2.killed) {
|
|
34663
|
-
return false;
|
|
34664
|
-
}
|
|
34665
|
-
return process2.exitCode === null;
|
|
34666
|
-
}
|
|
34667
34450
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34668
34451
|
0 && (module.exports = {
|
|
34669
34452
|
ActivationFlow,
|
|
34670
34453
|
AppleDeviceKit,
|
|
34671
|
-
createIosCli
|
|
34672
|
-
ensureUsbmuxd,
|
|
34673
|
-
isUsbmuxdRunning,
|
|
34674
|
-
startUsbmuxd,
|
|
34675
|
-
stopUsbmuxd
|
|
34454
|
+
createIosCli
|
|
34676
34455
|
});
|
|
34677
34456
|
/*! Bundled license information:
|
|
34678
34457
|
|