@api-client/core 0.5.21 → 0.5.24

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.
@@ -1,6 +1,6 @@
1
1
  import { IframeAuthorization } from './lib/IframeAuthorization.js';
2
2
  import { PopupAuthorization } from './lib/PopupAuthorization.js';
3
- import { IOAuth2Authorization, ITokenInfo } from 'src/models/Authorization.js';
3
+ import { IOAuth2Authorization, ITokenInfo } from '../models/Authorization.js';
4
4
  import { OauthProcessingOptions } from './types.js';
5
5
  export declare const resolveFunction: unique symbol;
6
6
  export declare const rejectFunction: unique symbol;
@@ -26,9 +26,9 @@ export interface ContextReadEventDetail {
26
26
  */
27
27
  id: string;
28
28
  /**
29
- * Optional revision of the state, when supported by the context provider.
29
+ * Optional parent, when needed.
30
30
  */
31
- rev?: string;
31
+ parent?: string;
32
32
  }
33
33
  /**
34
34
  * An event to be used to read a state from a context provider.
@@ -37,9 +37,9 @@ export declare class ContextReadEvent<T> extends ContextEvent<ContextReadEventDe
37
37
  /**
38
38
  * @param type The type of the event
39
39
  * @param id The domain id of the object to read
40
- * @param rev Optional revision of the state, when supported by the context provider.
40
+ * @param parent Optional parent, when needed.
41
41
  */
42
- constructor(type: string, id: string, rev?: string);
42
+ constructor(type: string, id: string, parent?: string);
43
43
  }
44
44
  export interface ContextReadBulkEventDetail {
45
45
  /**
@@ -71,15 +71,6 @@ export interface ContextChangeRecord<T> {
71
71
  * The ID of the changed context state object.
72
72
  */
73
73
  key: string;
74
- /**
75
- * The revision of the updated context state object.
76
- * It is not set when old revision is unavailable (new entity is created) or when the context provider does not support this value.
77
- */
78
- oldRev?: string;
79
- /**
80
- * New revision of updated state object. May not be set when the context provider does not support this value.
81
- */
82
- rev?: string;
83
74
  /**
84
75
  * The updated context state object.
85
76
  */
@@ -98,10 +89,6 @@ export interface ContextDeleteEventDetail {
98
89
  * The id of the parent object, if applicable.
99
90
  */
100
91
  parent?: string;
101
- /**
102
- * The revision to delete, when applicable.
103
- */
104
- rev?: string;
105
92
  }
106
93
  /**
107
94
  * An event to be used to delete a state in the context provider.
@@ -112,7 +99,7 @@ export declare class ContextDeleteEvent extends ContextEvent<ContextDeleteEventD
112
99
  * @param id The id of the object to delete
113
100
  * @param parent The id of the parent object, if applicable.
114
101
  */
115
- constructor(type: string, id: string, parent?: string, rev?: string);
102
+ constructor(type: string, id: string, parent?: string);
116
103
  }
117
104
  export interface ContextDeleteRecord {
118
105
  /**
@@ -26,10 +26,10 @@ export class ContextReadEvent extends ContextEvent {
26
26
  /**
27
27
  * @param type The type of the event
28
28
  * @param id The domain id of the object to read
29
- * @param rev Optional revision of the state, when supported by the context provider.
29
+ * @param parent Optional parent, when needed.
30
30
  */
31
- constructor(type, id, rev) {
32
- super(type, { id, rev });
31
+ constructor(type, id, parent) {
32
+ super(type, { id, parent });
33
33
  }
34
34
  }
35
35
  /**
@@ -53,8 +53,8 @@ export class ContextDeleteEvent extends ContextEvent {
53
53
  * @param id The id of the object to delete
54
54
  * @param parent The id of the parent object, if applicable.
55
55
  */
56
- constructor(type, id, parent, rev) {
57
- super(type, { id, parent, rev });
56
+ constructor(type, id, parent) {
57
+ super(type, { id, parent });
58
58
  }
59
59
  }
60
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEvents.js","sourceRoot":"","sources":["../../../src/events/BaseEvents.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAc3C;;GAEG;AACH,MAAM,OAAO,YAAkC,SAAQ,WAA4C;IACjG;;;OAGG;IACH,YAAY,IAAY,EAAE,MAAS;QACjC,KAAK,CAAC,IAAI,EAAE;YACV,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE;gBACN,MAAM,EAAE,SAAS;gBACjB,GAAG,MAAM;aACV;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAaD;;GAEG;AACH,MAAM,OAAO,gBAAoB,SAAQ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AA2B;QACnD,KAAK,CAAC,IAAI,EAAE;YACV,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAA2B,SAAQ,WAAmC;IACjF;;;OAGG;IACH,YAAY,IAAY,EAAE,MAA8B;QACtD,KAAK,CAAC,IAAI,EAAE;YACV,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;CACF;AAaD;;;;;GAKG;AACH,MAAM,OAAO,kBAA4C,SAAQ,YAAiE;IAChI,YAAY,IAAY,EAAE,UAAuC;QAC/D,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1B,CAAC;CACF;AAgCD,MAAM,OAAO,gBAAoB,SAAQ,YAAsD;IAC7F;;;OAGG;IACH,YAAY,IAAY,EAAE,OAA2B,EAAE;QACrD,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpB,CAAC;CACF"}
@@ -1,3 +1,4 @@
1
+ import { HttpCertificate } from "./ClientCertificate.js";
1
2
  export interface IBasicAuthorization {
2
3
  /**
3
4
  * User name value.
@@ -63,12 +64,9 @@ export interface IOAuth1Authorization {
63
64
  */
64
65
  export interface ICCAuthorization {
65
66
  /**
66
- * The ID of the certificate to use.
67
- * Because the certificates are stored by the application
68
- * this configuration only returns an ID of the certificate
69
- * to use when making the request.
67
+ * The certificate object to use with the HTTP request.
70
68
  */
71
- id: string;
69
+ certificate?: HttpCertificate;
72
70
  }
73
71
  export declare interface IOAuth2CustomParameter {
74
72
  /**
@@ -28,6 +28,10 @@ export class RequestAuthorization {
28
28
  });
29
29
  }
30
30
  static fromLegacy(info) {
31
+ const copy = { ...info };
32
+ if (copy.type === 'client certificate') {
33
+ copy.config = {};
34
+ }
31
35
  return new RequestAuthorization({
32
36
  kind: Kind,
33
37
  config: info.config,
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthorization.js","sourceRoot":"","sources":["../../../src/models/RequestAuthorization.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG,2BAA2B,CAAC;AA0BhD,MAAM,OAAO,oBAAoB;IAC/B,IAAI,GAAG,IAAI,CAAC;IACZ;;OAEG;IACH,MAAM,CAA+B;IACrC;;OAEG;IACH,IAAI,CAAqB;IACzB;;OAEG;IACH,OAAO,CAAW;IAClB;;;OAGG;IACH,KAAK,CAAW;IAEhB,MAAM,CAAC,eAAe,CAAC,IAAuB,EAAE,MAAmC,EAAE,KAAK,GAAC,IAAI;QAC7F,OAAO,IAAI,oBAAoB,CAAC;YAC9B,IAAI,EAAE,IAAI;YACV,MAAM;YACN,OAAO,EAAE,IAAI;YACb,IAAI;YACJ,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAyB;QACzC,OAAO,IAAI,oBAAoB,CAAC;YAC9B,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,IAAI,CAAC,IAAyB;YACpC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,YAAY,KAAoC;QAC9C,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,IAAI,GAAG,KAAK,CAAC;SACd;aAAM;YACL,IAAI,GAAG;gBACL,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,EAAuB;gBAC7B,KAA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ACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,MAAM,GAAC,EAAE,EAAE,GAAG,IAAI,CAAC;QAC3B,MAAM,MAAM,GAAyB;YACnC,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,KAAK;YAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAuB;YAC1C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;SAC1B,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
2
  import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { IRequestLog } from '../../../models/RequestLog.js';
4
4
  export declare class DeleteCookieRunnable extends ActionRunnable {
@@ -1,4 +1,4 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
2
  import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { ISetCookieAction } from '../../../models/actions/runnable/SetCookieAction.js';
4
4
  import { IRequestLog } from '../../../models/RequestLog.js';
@@ -1,4 +1,4 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
2
  import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { ISetVariableAction } from '../../../models/actions/runnable/SetVariableAction.js';
4
4
  import { IRequestLog } from '../../../models/RequestLog.js';
@@ -5,18 +5,14 @@ import applyCachedBasicAuthData, { applyRequestBasicAuthData } from './BasicAuth
5
5
  * Injects client certificate object into the request object
6
6
  */
7
7
  async function processClientCertificate(config, context) {
8
- const { id } = config;
9
- if (!id || !context.Events) {
10
- return;
11
- }
12
- const result = await context.Events.ClientCertificate.read(context.eventsTarget, id);
13
- if (!result) {
8
+ const { certificate } = config;
9
+ if (!certificate) {
14
10
  return;
15
11
  }
16
12
  if (!Array.isArray(context.certificates)) {
17
13
  context.certificates = [];
18
14
  }
19
- context.certificates.push(result);
15
+ context.certificates.push(certificate);
20
16
  }
21
17
  /**
22
18
  * Injects basic auth header into the request headers.
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthorization.js","sourceRoot":"","sources":["../../../../src/runtime/modules/RequestAuthorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,wBAAwB,EAAE,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAK1F;;GAEG;AACH,KAAK,UAAU,wBAAwB,CAAC,MAAwB,EAAE,OAAyB;IACzF,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAC1B,OAAO;KACR;IACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACxC,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;KAC3B;IACD,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAqB,EAAE,MAA2B;IAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,QAAQ,EAAE;QACb,OAA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AiB,CAAC,EAAE,CAAC;AAC9B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-client/core",
3
3
  "description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
4
- "version": "0.5.21",
4
+ "version": "0.5.24",
5
5
  "license": "Apache-2.0",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",
@@ -7,7 +7,7 @@ import { AuthorizationError, CodeError } from './AuthorizationError.js';
7
7
  import { IframeAuthorization } from './lib/IframeAuthorization.js';
8
8
  import { PopupAuthorization } from './lib/PopupAuthorization.js';
9
9
  import * as KnownGrants from './lib/KnownGrants.js';
10
- import { IOAuth2Authorization, ITokenInfo } from 'src/models/Authorization.js';
10
+ import { IOAuth2Authorization, ITokenInfo } from '../models/Authorization.js';
11
11
  import { OauthProcessingOptions } from './types.js';
12
12
 
13
13
  export const resolveFunction = Symbol('resolveFunction');
@@ -39,9 +39,9 @@ export interface ContextReadEventDetail {
39
39
  */
40
40
  id: string;
41
41
  /**
42
- * Optional revision of the state, when supported by the context provider.
42
+ * Optional parent, when needed.
43
43
  */
44
- rev?: string;
44
+ parent?: string;
45
45
  }
46
46
 
47
47
  /**
@@ -51,10 +51,10 @@ export class ContextReadEvent<T> extends ContextEvent<ContextReadEventDetail, T>
51
51
  /**
52
52
  * @param type The type of the event
53
53
  * @param id The domain id of the object to read
54
- * @param rev Optional revision of the state, when supported by the context provider.
54
+ * @param parent Optional parent, when needed.
55
55
  */
56
- constructor(type: string, id: string, rev?: string) {
57
- super(type, { id, rev });
56
+ constructor(type: string, id: string, parent?: string) {
57
+ super(type, { id, parent });
58
58
  }
59
59
  }
60
60
 
@@ -92,15 +92,6 @@ export interface ContextChangeRecord<T> {
92
92
  * The ID of the changed context state object.
93
93
  */
94
94
  key: string;
95
- /**
96
- * The revision of the updated context state object.
97
- * It is not set when old revision is unavailable (new entity is created) or when the context provider does not support this value.
98
- */
99
- oldRev?: string;
100
- /**
101
- * New revision of updated state object. May not be set when the context provider does not support this value.
102
- */
103
- rev?: string;
104
95
  /**
105
96
  * The updated context state object.
106
97
  */
@@ -120,10 +111,6 @@ export interface ContextDeleteEventDetail {
120
111
  * The id of the parent object, if applicable.
121
112
  */
122
113
  parent?: string;
123
- /**
124
- * The revision to delete, when applicable.
125
- */
126
- rev?: string;
127
114
  }
128
115
 
129
116
  /**
@@ -135,8 +122,8 @@ export class ContextDeleteEvent extends ContextEvent<ContextDeleteEventDetail, C
135
122
  * @param id The id of the object to delete
136
123
  * @param parent The id of the parent object, if applicable.
137
124
  */
138
- constructor(type: string, id: string, parent?: string, rev?: string) {
139
- super(type, { id, parent, rev });
125
+ constructor(type: string, id: string, parent?: string) {
126
+ super(type, { id, parent });
140
127
  }
141
128
  }
142
129
 
@@ -1,3 +1,5 @@
1
+ import { HttpCertificate } from "./ClientCertificate.js";
2
+
1
3
  export interface IBasicAuthorization {
2
4
  /**
3
5
  * User name value.
@@ -68,12 +70,9 @@ export interface IOAuth1Authorization {
68
70
  */
69
71
  export interface ICCAuthorization {
70
72
  /**
71
- * The ID of the certificate to use.
72
- * Because the certificates are stored by the application
73
- * this configuration only returns an ID of the certificate
74
- * to use when making the request.
73
+ * The certificate object to use with the HTTP request.
75
74
  */
76
- id: string;
75
+ certificate?: HttpCertificate;
77
76
  }
78
77
 
79
78
  export declare interface IOAuth2CustomParameter {
@@ -58,9 +58,13 @@ export class RequestAuthorization {
58
58
  }
59
59
 
60
60
  static fromLegacy(info: LegacyAuthorization): RequestAuthorization {
61
+ const copy = { ...info };
62
+ if (copy.type === 'client certificate') {
63
+ copy.config = {};
64
+ }
61
65
  return new RequestAuthorization({
62
66
  kind: Kind,
63
- config: info.config,
67
+ config: (info.config as any),
64
68
  enabled: true,
65
69
  type: info.type as AuthorizationType,
66
70
  valid: info.valid,
@@ -1,4 +1,4 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
2
  import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { IDeleteCookieAction } from '../../../models/actions/runnable/DeleteCookieAction.js';
4
4
  import { Events } from '../../../events/Events.js';
@@ -1,5 +1,5 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
2
- import { IHttpCookie } from 'src/models/HttpCookie.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
+ import { IHttpCookie } from '../../../models/HttpCookie.js';
3
3
  import { ActionRunnable } from './ActionRunnable.js';
4
4
  import { ISetCookieAction } from '../../../models/actions/runnable/SetCookieAction.js';
5
5
  import { Events } from '../../../events/Events.js';
@@ -1,4 +1,4 @@
1
- import { IHttpRequest } from 'src/models/HttpRequest.js';
1
+ import { IHttpRequest } from '../../../models/HttpRequest.js';
2
2
  import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { ISetVariableAction } from '../../../models/actions/runnable/SetVariableAction.js';
4
4
  import { Events } from '../../../events/Events.js';
@@ -9,18 +9,14 @@ import { ExecutionContext } from './ModulesRegistry.js';
9
9
  * Injects client certificate object into the request object
10
10
  */
11
11
  async function processClientCertificate(config: ICCAuthorization, context: ExecutionContext): Promise<void> {
12
- const { id } = config;
13
- if (!id || !context.Events) {
14
- return;
15
- }
16
- const result = await context.Events.ClientCertificate.read(context.eventsTarget, id);
17
- if (!result) {
12
+ const { certificate } = config;
13
+ if (!certificate) {
18
14
  return;
19
15
  }
20
16
  if (!Array.isArray(context.certificates)) {
21
17
  context.certificates = [];
22
18
  }
23
- context.certificates.push(result);
19
+ context.certificates.push(certificate);
24
20
  }
25
21
 
26
22
  /**