Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req = new pmCollection.Request(reqDef);
req.auth; // $ExpectType RequestAuth | undefined
req.body; // $ExpectType RequestBody | undefined
req.certificate; // $ExpectType Certificate | undefined
req.headers; // $ExpectType HeaderList
req.method; // $ExpectType string
req.proxy; // $ExpectType ProxyConfig | undefined
req.url; // $ExpectType Url
req.update(reqDef); // $ExpectType void
req.authorizeUsing("string"); // $ExpectType void
req.authorizeUsing({}); // $ExpectType void
req.authorizeUsing(null); // $ExpectType void
req.authorizeUsing("string", new pmCollection.VariableList(p, []));
req.getHeaders(); // $ExpectType any
req.getHeaders({ignoreCase: true}); // $ExpectType any
req.getHeaders({enabled: true}); // $ExpectType any
req.getHeaders({ignoreCase: true, enabled: true}); // $ExpectType any
req.forEachHeader((header: pmCollection.Header, context: pmCollection.Request) => {}); // $ExpectType void
req.addHeader(header); // $ExpectType void
req.addHeader(headerDef); // $ExpectType void
req.removeHeader("string"); // $ExpectType void
req.removeHeader(header); // $ExpectType void
req.removeHeader(header, {ignoreCase: true}); // $ExpectType void
req.upsertHeader(headerDef); // $ExpectType void
const reqAuthDef: pmCollection.RequestAuthDefinition = {};
reqAuthDef.type; // $ExpectType string | undefined
// RequestAuth Tests
let reqAuth = new pmCollection.RequestAuth(reqAuthDef);
reqAuth = new pmCollection.RequestAuth(reqAuthDef, collection);
reqAuth.type; // $ExpectType string
reqAuth.update(new pmCollection.VariableList(collection, [])); // $ExpectType void
reqAuth.update({key: "string", value: "string"}); // $ExpectType void
reqAuth.update([{key: "string", value: "string"}]); // $ExpectType void
reqAuth.update([{key: "string", value: "string"}], "string"); // $ExpectType void
reqAuth.use("string", new pmCollection.VariableList(collection, [])); // $ExpectType void
reqAuth.use("string", {key: "string", value: "string"}); // $ExpectType void
reqAuth.use("string", [{key: "string", value: "string"}]); // $ExpectType void
reqAuth.current(); // $ExpectType any
reqAuth.parameters(); // $ExpectType VariableList
reqAuth.clear("string"); // $ExpectType void
pmCollection.RequestAuth.isValidType(reqAuth); // $ExpectType boolean
// RequestBodyDefinition Tests
const reqBodyDef: pmCollection.RequestBodyDefinition = {mode: 'raw'};
reqBodyDef.mode; // $ExpectType string
reqBodyDef.raw; // $ExpectType string | undefined
pmCollection.Request.isRequest(req); // $ExpectType boolean
// RequestAuthDefinition Tests
const reqAuthDef: pmCollection.RequestAuthDefinition = {};
reqAuthDef.type; // $ExpectType string | undefined
// RequestAuth Tests
let reqAuth = new pmCollection.RequestAuth(reqAuthDef);
reqAuth = new pmCollection.RequestAuth(reqAuthDef, collection);
reqAuth.type; // $ExpectType string
reqAuth.update(new pmCollection.VariableList(collection, [])); // $ExpectType void
reqAuth.update({key: "string", value: "string"}); // $ExpectType void
reqAuth.update([{key: "string", value: "string"}]); // $ExpectType void
reqAuth.update([{key: "string", value: "string"}], "string"); // $ExpectType void
reqAuth.use("string", new pmCollection.VariableList(collection, [])); // $ExpectType void
reqAuth.use("string", {key: "string", value: "string"}); // $ExpectType void
reqAuth.use("string", [{key: "string", value: "string"}]); // $ExpectType void
reqAuth.current(); // $ExpectType any
reqAuth.parameters(); // $ExpectType VariableList
reqAuth.clear("string"); // $ExpectType void
pmCollection.RequestAuth.isValidType(reqAuth); // $ExpectType boolean
// Property Tests
const Property = pmCollection.Property;
let p = new Property();
p = new Property(propDef);
p = new Property({info: propDef, disabled: true});
p.id; // $ExpectType string
p.name; // $ExpectType string
p.disabled; // $ExpectType boolean
p.describe("string"); // $ExpectType void
p.describe("String", "string"); // $ExpectType void
p.toObjectResolved(null, []); // $ExpectType {}
p.toObjectResolved({variables: new pmCollection.VariableList(p, [])}, []); // $ExpectType {}
p.toObjectResolved(null, [], {ignoreOwnVariables: true}); // $ExpectType {}
Property.replaceSubstitutions("string", new pmCollection.VariableList(p, [])); // $ExpectType string
Property.replaceSubstitutionsIn({}, [new pmCollection.VariableList(p, [])], false); // $ExpectType {}
// CertificateDefinition Tests
const certDef: pmCollection.CertificateDefinition = {};
certDef.matches; // $ExpectType string[] | UrlMatchPatternList | undefined
certDef.key; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.cert; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.passphrase; // $ExpectType string | undefined
// Certificate Tests
const certificate = new pmCollection.Certificate({});
certificate.cert; // $ExpectType { src?: string | undefined; }
certificate.key; // $ExpectType { src?: string | undefined; }
// ItemGroupDefinition Tests
const igDef: pmCollection.ItemGroupDefinition = {};
igDef.item; // $ExpectType (ItemGroupDefinition | ItemDefinition)[] | undefined
igDef.auth; // $ExpectType RequestAuthDefinition | undefined
igDef.event; // $ExpectType EventDefinition[] | undefined
// ItemGroup Tests
const ig = new pmCollection.ItemGroup();
ig.auth; // $ExpectType RequestAuth | undefined
ig.items; // $ExpectType PropertyList
ig.events; // $ExpectType EventList
ig.authorizeRequestsUsing("string"); // $ExpectType void
ig.authorizeRequestsUsing({}); // $ExpectType void
ig.authorizeRequestsUsing("string", new pmCollection.VariableList(ig, [])); // $ExpectType void
ig.forEachItem((el) => {}); // $ExpectType void
ig.forEachItemGroup((el) => {}); // $ExpectType void
ig.oneDeep("string"); // $ExpectType Certificate
pmCollection.ItemGroup.isItemGroup(ig); // $ExpectType boolean
// CollectionDefinition Tests
const colDef: pmCollection.CollectionDefinition = {};
colDef.info; // $ExpectType { id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined
colDef.variable; // $ExpectType VariableDefinition | undefined
let collection: pmCollection.Collection;
collection = new pmCollection.Collection();
collection = new pmCollection.Collection({});
const itemDef: pmCollection.ItemDefinition = {};
itemDef.request; // $ExpectType RequestDefinition | undefined
itemDef.responses; // $ExpectType ResponseDefinition[] | undefined
itemDef.events; // $ExpectType EventDefinition[] | undefined
// Item Tests
let item = new pmCollection.Item();
item = new pmCollection.Item(itemDef);
item.events; // $ExpectType EventList
item.request; // $ExpectType Request
item.responses; // $ExpectType PropertyList
item.authorizeRequestUsing("string"); // $ExpectType void
item.authorizeRequestUsing({}); // $ExpectType void
item.authorizeRequestUsing("string", new pmCollection.VariableList(item, [])); // $ExpectType void
item.getAuth(); // $ExpectType RequestAuth
item.getEvents(); // $ExpectType Event[]
item.getEvents("string"); // $ExpectType Event[]
pmCollection.Item.isItem(item); // $ExpectType boolean
// ProxyConfigDefinition Tests
const proxyConfDef: pmCollection.ProxyConfigDefinition = {};
proxyConfDef.match; // $ExpectType string | { pattern: string; } | UrlMatchPattern | undefined
proxyConfDef.host; // $ExpectType string | undefined
proxyConfDef.port; // $ExpectType number | undefined
proxyConfDef.tunnel; // $ExpectType boolean | undefined
variable.valueType("string", true); // $ExpectType string
variable.update(varDef); // $ExpectType void
pmCollection.Variable.isVariable(variable); // $ExpectType boolean
pmCollection.Variable.types.string; // $ExpectType StringConstructor
pmCollection.Variable.types.boolean; // $ExpectType BooleanConstructor
pmCollection.Variable.types.number; // $ExpectType NumberConstructor
pmCollection.Variable.types.json; // $ExpectType { in: (val: any) => string; out: (val: string) => any; }
pmCollection.Variable.types.any; // $ExpectType { in: (val: T) => T; out: (val: T) => T; }
// VariableList Tests
const vList = new pmCollection.VariableList(collection, [variable]);
vList.replace("string"); // $ExpectType string
vList.replace("string", vList); // $ExpectType string
vList.substitute("string"); // $ExpectType "string"
vList.substitute({}, vList); // $ExpectType {}
vList.substitute(null, vList, false); // $ExpectType null
vList.syncFromObject({}); // $ExpectType { created: string[]; updated: string[]; deleted: string[]; } | undefined
vList.syncFromObject({}, false); // $ExpectType { created: string[]; updated: string[]; deleted: string[]; } | undefined
vList.syncFromObject({}, false, false); // $ExpectType { created: string[]; updated: string[]; deleted: string[]; } | undefined
vList.syncToObject(); // $ExpectType { [key: string]: VariableDefinition; }
vList.syncToObject({key: varDef}); // $ExpectType { [key: string]: VariableDefinition; }
pmCollection.VariableList.isVariableList(vList); // $ExpectType boolean
let p = new Property();
p = new Property(propDef);
p = new Property({info: propDef, disabled: true});
p.id; // $ExpectType string
p.name; // $ExpectType string
p.disabled; // $ExpectType boolean
p.describe("string"); // $ExpectType void
p.describe("String", "string"); // $ExpectType void
p.toObjectResolved(null, []); // $ExpectType {}
p.toObjectResolved({variables: new pmCollection.VariableList(p, [])}, []); // $ExpectType {}
p.toObjectResolved(null, [], {ignoreOwnVariables: true}); // $ExpectType {}
Property.replaceSubstitutions("string", new pmCollection.VariableList(p, [])); // $ExpectType string
Property.replaceSubstitutionsIn({}, [new pmCollection.VariableList(p, [])], false); // $ExpectType {}
// CertificateDefinition Tests
const certDef: pmCollection.CertificateDefinition = {};
certDef.matches; // $ExpectType string[] | UrlMatchPatternList | undefined
certDef.key; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.cert; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.passphrase; // $ExpectType string | undefined
// Certificate Tests
const certificate = new pmCollection.Certificate({});
certificate.cert; // $ExpectType { src?: string | undefined; }
certificate.key; // $ExpectType { src?: string | undefined; }
certificate.matches; // $ExpectType UrlMatchPatternList
certificate.passphrase; // $ExpectType string
p = new Property(propDef);
p = new Property({info: propDef, disabled: true});
p.id; // $ExpectType string
p.name; // $ExpectType string
p.disabled; // $ExpectType boolean
p.describe("string"); // $ExpectType void
p.describe("String", "string"); // $ExpectType void
p.toObjectResolved(null, []); // $ExpectType {}
p.toObjectResolved({variables: new pmCollection.VariableList(p, [])}, []); // $ExpectType {}
p.toObjectResolved(null, [], {ignoreOwnVariables: true}); // $ExpectType {}
Property.replaceSubstitutions("string", new pmCollection.VariableList(p, [])); // $ExpectType string
Property.replaceSubstitutionsIn({}, [new pmCollection.VariableList(p, [])], false); // $ExpectType {}
// CertificateDefinition Tests
const certDef: pmCollection.CertificateDefinition = {};
certDef.matches; // $ExpectType string[] | UrlMatchPatternList | undefined
certDef.key; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.cert; // $ExpectType string | { src?: string | undefined; } | undefined
certDef.passphrase; // $ExpectType string | undefined
// Certificate Tests
const certificate = new pmCollection.Certificate({});
certificate.cert; // $ExpectType { src?: string | undefined; }
certificate.key; // $ExpectType { src?: string | undefined; }
certificate.matches; // $ExpectType UrlMatchPatternList
certificate.passphrase; // $ExpectType string
certificate.canApplyTo("string"); // $ExpectType boolean