@milaboratories/pl-model-common 1.21.1 → 1.21.2

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/httpAuth.cjs CHANGED
@@ -21,7 +21,6 @@ function serializeHttpAuth(input) {
21
21
  if (input.scheme === 'Basic') {
22
22
  return `Basic ${btoa(`${input.username}:${input.password}`)}`;
23
23
  }
24
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
25
24
  throw new Error(`Unsupported auth scheme: ${input.scheme}.`);
26
25
  }
27
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"httpAuth.cjs","sources":["../src/httpAuth.ts"],"sourcesContent":["/* TODO: replace atob/btoa with Uint8Array.toBase64/fromBase64 in the future */\n\nexport function parseHttpAuth(input: string): HttpAuth {\n const match = /(?<scheme>.*?) (?<parameters>.*)/.exec(input);\n if (match?.groups?.scheme === 'Basic') {\n const credentialsMatch = /(?<username>.*?):(?<password>.*)/\n .exec(atob(match.groups.parameters));\n if (!credentialsMatch?.groups) {\n throw new Error(`Malformed credentials.`);\n }\n return {\n scheme: 'Basic',\n username: credentialsMatch.groups.username,\n password: credentialsMatch.groups.password,\n };\n }\n throw new Error(`Unsupported auth scheme: ${match?.groups?.scheme}.`);\n}\n\nexport function serializeHttpAuth(input: HttpAuth): string {\n if (input.scheme === 'Basic') {\n return `Basic ${btoa(`${input.username}:${input.password}`)}`;\n }\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported auth scheme: ${input.scheme}.`);\n}\n\nexport type HttpAuth = BasicHttpAuth;\n\nexport interface BasicHttpAuth {\n scheme: 'Basic';\n username: string;\n password: string;\n}\n"],"names":[],"mappings":";;AAAA;AAEM,SAAU,aAAa,CAAC,KAAa,EAAA;IACzC,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5D,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,EAAE;QACrC,MAAM,gBAAgB,GAAG;aACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;AAC7B,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,CAAwB,CAAC;QAC3C;QACA,OAAO;AACL,YAAA,MAAM,EAAE,OAAO;AACf,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;AAC1C,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;SAC3C;IACH;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,EAAE,MAAM,EAAE,MAAM,CAAA,CAAA,CAAG,CAAC;AACvE;AAEM,SAAU,iBAAiB,CAAC,KAAe,EAAA;AAC/C,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;AAC5B,QAAA,OAAO,CAAA,MAAA,EAAS,IAAI,CAAC,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ,CAAA,CAAE,CAAC,EAAE;IAC/D;;IAEA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,CAAC,MAAM,CAAA,CAAA,CAAG,CAAC;AAC9D;;;;;"}
1
+ {"version":3,"file":"httpAuth.cjs","sources":["../src/httpAuth.ts"],"sourcesContent":["/* TODO: replace atob/btoa with Uint8Array.toBase64/fromBase64 in the future */\n\nexport function parseHttpAuth(input: string): HttpAuth {\n const match = /(?<scheme>.*?) (?<parameters>.*)/.exec(input);\n if (match?.groups?.scheme === 'Basic') {\n const credentialsMatch = /(?<username>.*?):(?<password>.*)/\n .exec(atob(match.groups.parameters));\n if (!credentialsMatch?.groups) {\n throw new Error(`Malformed credentials.`);\n }\n return {\n scheme: 'Basic',\n username: credentialsMatch.groups.username,\n password: credentialsMatch.groups.password,\n };\n }\n throw new Error(`Unsupported auth scheme: ${match?.groups?.scheme}.`);\n}\n\nexport function serializeHttpAuth(input: HttpAuth): string {\n if (input.scheme === 'Basic') {\n return `Basic ${btoa(`${input.username}:${input.password}`)}`;\n }\n throw new Error(`Unsupported auth scheme: ${input.scheme as string}.`);\n}\n\nexport type HttpAuth = BasicHttpAuth;\n\nexport interface BasicHttpAuth {\n scheme: 'Basic';\n username: string;\n password: string;\n}\n"],"names":[],"mappings":";;AAAA;AAEM,SAAU,aAAa,CAAC,KAAa,EAAA;IACzC,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5D,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,EAAE;QACrC,MAAM,gBAAgB,GAAG;aACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;AAC7B,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,CAAwB,CAAC;QAC3C;QACA,OAAO;AACL,YAAA,MAAM,EAAE,OAAO;AACf,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;AAC1C,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;SAC3C;IACH;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,EAAE,MAAM,EAAE,MAAM,CAAA,CAAA,CAAG,CAAC;AACvE;AAEM,SAAU,iBAAiB,CAAC,KAAe,EAAA;AAC/C,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;AAC5B,QAAA,OAAO,CAAA,MAAA,EAAS,IAAI,CAAC,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ,CAAA,CAAE,CAAC,EAAE;IAC/D;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,CAAC,MAAgB,CAAA,CAAA,CAAG,CAAC;AACxE;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"httpAuth.d.ts","sourceRoot":"","sources":["../src/httpAuth.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAerD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAMzD;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"httpAuth.d.ts","sourceRoot":"","sources":["../src/httpAuth.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAerD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAKzD;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
package/dist/httpAuth.js CHANGED
@@ -19,7 +19,6 @@ function serializeHttpAuth(input) {
19
19
  if (input.scheme === 'Basic') {
20
20
  return `Basic ${btoa(`${input.username}:${input.password}`)}`;
21
21
  }
22
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
23
22
  throw new Error(`Unsupported auth scheme: ${input.scheme}.`);
24
23
  }
25
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"httpAuth.js","sources":["../src/httpAuth.ts"],"sourcesContent":["/* TODO: replace atob/btoa with Uint8Array.toBase64/fromBase64 in the future */\n\nexport function parseHttpAuth(input: string): HttpAuth {\n const match = /(?<scheme>.*?) (?<parameters>.*)/.exec(input);\n if (match?.groups?.scheme === 'Basic') {\n const credentialsMatch = /(?<username>.*?):(?<password>.*)/\n .exec(atob(match.groups.parameters));\n if (!credentialsMatch?.groups) {\n throw new Error(`Malformed credentials.`);\n }\n return {\n scheme: 'Basic',\n username: credentialsMatch.groups.username,\n password: credentialsMatch.groups.password,\n };\n }\n throw new Error(`Unsupported auth scheme: ${match?.groups?.scheme}.`);\n}\n\nexport function serializeHttpAuth(input: HttpAuth): string {\n if (input.scheme === 'Basic') {\n return `Basic ${btoa(`${input.username}:${input.password}`)}`;\n }\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported auth scheme: ${input.scheme}.`);\n}\n\nexport type HttpAuth = BasicHttpAuth;\n\nexport interface BasicHttpAuth {\n scheme: 'Basic';\n username: string;\n password: string;\n}\n"],"names":[],"mappings":"AAAA;AAEM,SAAU,aAAa,CAAC,KAAa,EAAA;IACzC,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5D,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,EAAE;QACrC,MAAM,gBAAgB,GAAG;aACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;AAC7B,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,CAAwB,CAAC;QAC3C;QACA,OAAO;AACL,YAAA,MAAM,EAAE,OAAO;AACf,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;AAC1C,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;SAC3C;IACH;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,EAAE,MAAM,EAAE,MAAM,CAAA,CAAA,CAAG,CAAC;AACvE;AAEM,SAAU,iBAAiB,CAAC,KAAe,EAAA;AAC/C,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;AAC5B,QAAA,OAAO,CAAA,MAAA,EAAS,IAAI,CAAC,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ,CAAA,CAAE,CAAC,EAAE;IAC/D;;IAEA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,CAAC,MAAM,CAAA,CAAA,CAAG,CAAC;AAC9D;;;;"}
1
+ {"version":3,"file":"httpAuth.js","sources":["../src/httpAuth.ts"],"sourcesContent":["/* TODO: replace atob/btoa with Uint8Array.toBase64/fromBase64 in the future */\n\nexport function parseHttpAuth(input: string): HttpAuth {\n const match = /(?<scheme>.*?) (?<parameters>.*)/.exec(input);\n if (match?.groups?.scheme === 'Basic') {\n const credentialsMatch = /(?<username>.*?):(?<password>.*)/\n .exec(atob(match.groups.parameters));\n if (!credentialsMatch?.groups) {\n throw new Error(`Malformed credentials.`);\n }\n return {\n scheme: 'Basic',\n username: credentialsMatch.groups.username,\n password: credentialsMatch.groups.password,\n };\n }\n throw new Error(`Unsupported auth scheme: ${match?.groups?.scheme}.`);\n}\n\nexport function serializeHttpAuth(input: HttpAuth): string {\n if (input.scheme === 'Basic') {\n return `Basic ${btoa(`${input.username}:${input.password}`)}`;\n }\n throw new Error(`Unsupported auth scheme: ${input.scheme as string}.`);\n}\n\nexport type HttpAuth = BasicHttpAuth;\n\nexport interface BasicHttpAuth {\n scheme: 'Basic';\n username: string;\n password: string;\n}\n"],"names":[],"mappings":"AAAA;AAEM,SAAU,aAAa,CAAC,KAAa,EAAA;IACzC,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5D,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,EAAE;QACrC,MAAM,gBAAgB,GAAG;aACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;AAC7B,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,CAAwB,CAAC;QAC3C;QACA,OAAO;AACL,YAAA,MAAM,EAAE,OAAO;AACf,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;AAC1C,YAAA,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;SAC3C;IACH;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,EAAE,MAAM,EAAE,MAAM,CAAA,CAAA,CAAG,CAAC;AACvE;AAEM,SAAU,iBAAiB,CAAC,KAAe,EAAA;AAC/C,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;AAC5B,QAAA,OAAO,CAAA,MAAA,EAAS,IAAI,CAAC,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ,CAAA,CAAE,CAAC,EAAE;IAC/D;IACA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,KAAK,CAAC,MAAgB,CAAA,CAAA,CAAG,CAAC;AACxE;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-model-common",
3
- "version": "1.21.1",
3
+ "version": "1.21.2",
4
4
  "description": "Platforma SDK Model",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -26,9 +26,9 @@
26
26
  "typescript": "~5.6.3",
27
27
  "vitest": "^2.1.9",
28
28
  "@milaboratories/ts-builder": "1.0.5",
29
+ "@platforma-sdk/eslint-config": "1.1.0",
29
30
  "@milaboratories/ts-configs": "1.0.6",
30
- "@milaboratories/build-configs": "1.0.8",
31
- "@platforma-sdk/eslint-config": "1.1.0"
31
+ "@milaboratories/build-configs": "1.0.8"
32
32
  },
33
33
  "scripts": {
34
34
  "type-check": "ts-builder types --target node",
package/src/httpAuth.ts CHANGED
@@ -21,8 +21,7 @@ export function serializeHttpAuth(input: HttpAuth): string {
21
21
  if (input.scheme === 'Basic') {
22
22
  return `Basic ${btoa(`${input.username}:${input.password}`)}`;
23
23
  }
24
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
25
- throw new Error(`Unsupported auth scheme: ${input.scheme}.`);
24
+ throw new Error(`Unsupported auth scheme: ${input.scheme as string}.`);
26
25
  }
27
26
 
28
27
  export type HttpAuth = BasicHttpAuth;