@api-client/core 0.12.5 → 0.12.7
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/build/src/amf/ApiSchemaValues.d.ts +6 -2
- package/build/src/amf/ApiSchemaValues.d.ts.map +1 -1
- package/build/src/amf/ApiSchemaValues.js +17 -12
- package/build/src/amf/ApiSchemaValues.js.map +1 -1
- package/build/src/amf/shape/ShapeBase.d.ts +1 -1
- package/build/src/amf/shape/ShapeBase.d.ts.map +1 -1
- package/build/src/amf/shape/ShapeBase.js +1 -1
- package/build/src/amf/shape/ShapeBase.js.map +1 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts.map +1 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +1 -2
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -1
- package/build/src/events/BaseEvents.d.ts +3 -3
- package/build/src/events/BaseEvents.d.ts.map +1 -1
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/mocking/LegacyInterfaces.d.ts +1 -1
- package/build/src/mocking/LegacyInterfaces.d.ts.map +1 -1
- package/build/src/mocking/LegacyInterfaces.js.map +1 -1
- package/build/src/mocking/LegacyMock.d.ts +1 -1
- package/build/src/mocking/LegacyMock.d.ts.map +1 -1
- package/build/src/mocking/LegacyMock.js +1 -1
- package/build/src/mocking/LegacyMock.js.map +1 -1
- package/build/src/mocking/ProjectMock.d.ts +2 -1
- package/build/src/mocking/ProjectMock.d.ts.map +1 -1
- package/build/src/mocking/ProjectMock.js +1 -1
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/legacy/Authorization.d.ts +2 -1
- package/build/src/mocking/legacy/Authorization.d.ts.map +1 -1
- package/build/src/mocking/legacy/Authorization.js +2 -1
- package/build/src/mocking/legacy/Authorization.js.map +1 -1
- package/build/src/mocking/legacy/Certificates.d.ts +3 -1
- package/build/src/mocking/legacy/Certificates.d.ts.map +1 -1
- package/build/src/mocking/legacy/Certificates.js +6 -3
- package/build/src/mocking/legacy/Certificates.js.map +1 -1
- package/build/src/mocking/legacy/Cookies.d.ts +3 -1
- package/build/src/mocking/legacy/Cookies.d.ts.map +1 -1
- package/build/src/mocking/legacy/Cookies.js +3 -1
- package/build/src/mocking/legacy/Cookies.js.map +1 -1
- package/build/src/mocking/legacy/HostRules.d.ts +3 -1
- package/build/src/mocking/legacy/HostRules.d.ts.map +1 -1
- package/build/src/mocking/legacy/HostRules.js +3 -1
- package/build/src/mocking/legacy/HostRules.js.map +1 -1
- package/build/src/mocking/legacy/Http.d.ts +6 -1
- package/build/src/mocking/legacy/Http.d.ts.map +1 -1
- package/build/src/mocking/legacy/Http.js +5 -1
- package/build/src/mocking/legacy/Http.js.map +1 -1
- package/build/src/mocking/legacy/HttpResponse.d.ts +3 -2
- package/build/src/mocking/legacy/HttpResponse.d.ts.map +1 -1
- package/build/src/mocking/legacy/HttpResponse.js +2 -2
- package/build/src/mocking/legacy/HttpResponse.js.map +1 -1
- package/build/src/mocking/legacy/RestApi.d.ts +3 -1
- package/build/src/mocking/legacy/RestApi.d.ts.map +1 -1
- package/build/src/mocking/legacy/RestApi.js +3 -1
- package/build/src/mocking/legacy/RestApi.js.map +1 -1
- package/build/src/mocking/legacy/Urls.d.ts +3 -1
- package/build/src/mocking/legacy/Urls.d.ts.map +1 -1
- package/build/src/mocking/legacy/Urls.js +3 -1
- package/build/src/mocking/legacy/Urls.js.map +1 -1
- package/build/src/mocking/legacy/Variables.d.ts +2 -1
- package/build/src/mocking/legacy/Variables.d.ts.map +1 -1
- package/build/src/mocking/legacy/Variables.js +2 -1
- package/build/src/mocking/legacy/Variables.js.map +1 -1
- package/build/src/mocking/lib/Certificates.d.ts +4 -1
- package/build/src/mocking/lib/Certificates.d.ts.map +1 -1
- package/build/src/mocking/lib/Certificates.js +5 -2
- package/build/src/mocking/lib/Certificates.js.map +1 -1
- package/build/src/mocking/lib/History.d.ts +5 -1
- package/build/src/mocking/lib/History.d.ts.map +1 -1
- package/build/src/mocking/lib/History.js +4 -1
- package/build/src/mocking/lib/History.js.map +1 -1
- package/build/src/mocking/lib/HostRules.d.ts +4 -1
- package/build/src/mocking/lib/HostRules.d.ts.map +1 -1
- package/build/src/mocking/lib/HostRules.js +3 -1
- package/build/src/mocking/lib/HostRules.js.map +1 -1
- package/build/src/mocking/lib/Request.d.ts +5 -1
- package/build/src/mocking/lib/Request.d.ts.map +1 -1
- package/build/src/mocking/lib/Request.js +4 -1
- package/build/src/mocking/lib/Request.js.map +1 -1
- package/build/src/mocking/lib/Response.d.ts +7 -1
- package/build/src/mocking/lib/Response.d.ts.map +1 -1
- package/build/src/mocking/lib/Response.js +6 -1
- package/build/src/mocking/lib/Response.js.map +1 -1
- package/build/src/mocking/lib/Url.d.ts +4 -1
- package/build/src/mocking/lib/Url.d.ts.map +1 -1
- package/build/src/mocking/lib/Url.js +3 -1
- package/build/src/mocking/lib/Url.js.map +1 -1
- package/build/src/mocking/lib/User.d.ts +5 -1
- package/build/src/mocking/lib/User.d.ts.map +1 -1
- package/build/src/mocking/lib/User.js +4 -1
- package/build/src/mocking/lib/User.js.map +1 -1
- package/build/src/modeling/DataDomain.d.ts +1 -1
- package/build/src/modeling/DataDomain.d.ts.map +1 -1
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
- package/build/src/modeling/DomainAssociation.js +2 -3
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainSerialization.d.ts.map +1 -1
- package/build/src/modeling/DomainSerialization.js +1 -1
- package/build/src/modeling/DomainSerialization.js.map +1 -1
- package/build/src/modeling/DomainVersioning.js.map +1 -1
- package/build/src/modeling/GraphUtils.d.ts +1 -1
- package/build/src/modeling/GraphUtils.d.ts.map +1 -1
- package/build/src/modeling/GraphUtils.js.map +1 -1
- package/build/src/modeling/legacy/DataAssociation.d.ts.map +1 -1
- package/build/src/modeling/legacy/DataAssociation.js +4 -5
- package/build/src/modeling/legacy/DataAssociation.js.map +1 -1
- package/build/src/modeling/legacy/DataProperty.d.ts.map +1 -1
- package/build/src/modeling/legacy/DataProperty.js +4 -5
- package/build/src/modeling/legacy/DataProperty.js.map +1 -1
- package/build/src/modeling/types.d.ts +2 -1
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/models/ProjectExecution.d.ts.map +1 -1
- package/build/src/models/ProjectExecution.js +2 -3
- package/build/src/models/ProjectExecution.js.map +1 -1
- package/build/src/models/Request.d.ts.map +1 -1
- package/build/src/models/Request.js +4 -5
- package/build/src/models/Request.js.map +1 -1
- package/build/src/models/store/Revision.d.ts +1 -1
- package/build/src/models/store/Revision.d.ts.map +1 -1
- package/build/src/models/store/Revision.js.map +1 -1
- package/build/src/patch/PatchClient.d.ts +2 -1
- package/build/src/patch/PatchClient.d.ts.map +1 -1
- package/build/src/patch/PatchClient.js +1 -1
- package/build/src/patch/PatchClient.js.map +1 -1
- package/build/src/patch/types.d.ts +1 -1
- package/build/src/patch/types.d.ts.map +1 -1
- package/build/src/patch/types.js.map +1 -1
- package/data/models/example-generator-api.json +22 -22
- package/package.json +21 -20
- package/src/amf/ApiSchemaValues.ts +18 -13
- package/src/amf/shape/ShapeBase.ts +1 -1
- package/src/amf/shape/ShapeXmlSchemaGenerator.ts +1 -2
- package/src/events/BaseEvents.ts +3 -3
- package/src/mocking/LegacyInterfaces.ts +1 -1
- package/src/mocking/LegacyMock.ts +1 -1
- package/src/mocking/ProjectMock.ts +2 -1
- package/src/mocking/legacy/Authorization.ts +2 -1
- package/src/mocking/legacy/Certificates.ts +6 -3
- package/src/mocking/legacy/Cookies.ts +3 -1
- package/src/mocking/legacy/HostRules.ts +3 -1
- package/src/mocking/legacy/Http.ts +6 -1
- package/src/mocking/legacy/HttpResponse.ts +3 -7
- package/src/mocking/legacy/RestApi.ts +3 -1
- package/src/mocking/legacy/Urls.ts +3 -1
- package/src/mocking/legacy/Variables.ts +2 -1
- package/src/mocking/lib/Certificates.ts +6 -2
- package/src/mocking/lib/History.ts +5 -1
- package/src/mocking/lib/HostRules.ts +4 -1
- package/src/mocking/lib/Request.ts +5 -1
- package/src/mocking/lib/Response.ts +7 -12
- package/src/mocking/lib/Url.ts +4 -1
- package/src/mocking/lib/User.ts +5 -1
- package/src/modeling/DataDomain.ts +1 -1
- package/src/modeling/DomainAssociation.ts +2 -3
- package/src/modeling/DomainSerialization.ts +2 -1
- package/src/modeling/DomainVersioning.ts +1 -1
- package/src/modeling/GraphUtils.ts +1 -1
- package/src/modeling/legacy/DataAssociation.ts +4 -5
- package/src/modeling/legacy/DataProperty.ts +4 -5
- package/src/modeling/types.ts +2 -1
- package/src/models/ProjectExecution.ts +2 -3
- package/src/models/Request.ts +4 -5
- package/src/models/store/Revision.ts +1 -1
- package/src/patch/PatchClient.ts +2 -1
- package/src/patch/types.ts +1 -1
- package/tests/servers/express-routes/StreamApi.ts +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../src/models/Request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../src/models/Request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACvF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAA;AAK1E,OAAO,EAAE,YAAY,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAA;AACrF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAInF,OAAO,EAAE,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
-
import { Json } from '@api-client/json';
|
|
2
1
|
import { RequestConfig } from './RequestConfig.js';
|
|
3
2
|
import { Thing } from './Thing.js';
|
|
4
3
|
import { Certificate } from './ClientCertificate.js';
|
|
@@ -309,13 +308,13 @@ export class Request {
|
|
|
309
308
|
this.midnight = midnight;
|
|
310
309
|
}
|
|
311
310
|
if (Array.isArray(flows)) {
|
|
312
|
-
this.flows = flows.map((i) =>
|
|
311
|
+
this.flows = flows.map((i) => structuredClone(i));
|
|
313
312
|
}
|
|
314
313
|
else {
|
|
315
314
|
this.flows = undefined;
|
|
316
315
|
}
|
|
317
316
|
if (Array.isArray(assertions)) {
|
|
318
|
-
this.assertions = assertions.map((i) =>
|
|
317
|
+
this.assertions = assertions.map((i) => structuredClone(i));
|
|
319
318
|
}
|
|
320
319
|
else {
|
|
321
320
|
this.assertions = undefined;
|
|
@@ -346,10 +345,10 @@ export class Request {
|
|
|
346
345
|
result.authorization = this.authorization.map((i) => i.toJSON());
|
|
347
346
|
}
|
|
348
347
|
if (Array.isArray(this.flows)) {
|
|
349
|
-
result.flows = this.flows.map((i) =>
|
|
348
|
+
result.flows = this.flows.map((i) => structuredClone(i));
|
|
350
349
|
}
|
|
351
350
|
if (Array.isArray(this.assertions)) {
|
|
352
|
-
result.assertions = this.assertions.map((i) =>
|
|
351
|
+
result.assertions = this.assertions.map((i) => structuredClone(i));
|
|
353
352
|
}
|
|
354
353
|
if (this.clientCertificate) {
|
|
355
354
|
result.clientCertificate = this.clientCertificate.toJSON();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../../src/models/Request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAkB,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAU,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAmB,WAAW,EAAE,MAAM,wBAAwB,CAAA;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E,CAAA;IAC3B,CAAC;CACF","sourcesContent":["import { Json } from '@api-client/json'\nimport { IRequestConfig, RequestConfig } from './RequestConfig.js'\nimport { Thing, IThing } from './Thing.js'\nimport { HttpCertificate, Certificate } from './ClientCertificate.js'\nimport { IRequestAuthorization, RequestAuthorization } from './RequestAuthorization.js'\nimport { IRequestLog, RequestLog, Kind as LogKind } from './RequestLog.js'\nimport { SentRequest } from './SentRequest.js'\nimport { ErrorResponse } from './ErrorResponse.js'\nimport { Response } from './Response.js'\nimport { RequestsSize } from './RequestsSize.js'\nimport { IHttpRequest, HttpRequest, Kind as HttpRequestKind } from './HttpRequest.js'\nimport { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js'\nimport { ErrorResponse as LegacyErrorResponse, Response as LegacyResponse } from './legacy/request/ArcResponse.js'\nimport { PayloadSerializer } from '../lib/transformers/PayloadSerializer.js'\nimport { Normalizer } from './legacy/Normalizer.js'\nimport { IHttpFlow } from './http-flows/HttpFlows.js'\nimport { IHttpAssertion } from './http-flows/HttpAssertion.js'\nimport { LegacyTranslator } from './http-flows/LegacyTranslator.js'\n\nexport const Kind = 'Core#Request'\nexport const createdSymbol = Symbol('created')\nexport const updatedSymbol = Symbol('updated')\nexport const midnightSymbol = Symbol('midnight')\n\n/**\n * The definition of a request object that functions inside API Client\n * with the full configuration.\n */\nexport interface IRequest {\n kind: string\n /**\n * The basic information about the request.\n */\n info: IThing\n /**\n * The HTTP definition of the request.\n */\n expects: IHttpRequest\n /**\n * The execution log of the last HTTP request with a response.\n */\n log?: IRequestLog\n /**\n * Timestamp when the request was last updated.\n */\n updated?: number\n /**\n * Timestamp when the request was created.\n */\n created?: number\n /**\n * A timestamp of the midnight when the request object was updated\n */\n midnight?: number\n /**\n * Request processing configuration.\n */\n config?: IRequestConfig\n /**\n * Request authorization configuration\n */\n authorization?: IRequestAuthorization[]\n /**\n * Http action flows.\n * In ARC this was \"actions\",\n */\n flows?: IHttpFlow[]\n /**\n * The certificate to use with the request.\n * Note, the certificate defined on the certificate authorization\n * should not be included here by default. The HTTP transport should recognize\n * this certificate and update the configuration.\n */\n clientCertificate?: HttpCertificate\n\n /**\n * The list of assertions (tests) to perform after the response is ready.\n */\n assertions?: IHttpAssertion[]\n}\n\nexport class Request {\n [createdSymbol] = 0;\n [updatedSymbol] = 0;\n [midnightSymbol] = 0\n kind = Kind\n /**\n * The basic information about the project.\n */\n info: Thing = new Thing()\n /**\n * The HTTP definition of the request.\n */\n expects: HttpRequest = new HttpRequest()\n /**\n * The execution log of the last HTTP request with a response.\n */\n log?: RequestLog\n /**\n * Request processing configuration.\n */\n config?: RequestConfig\n /**\n * Request authorization configuration\n */\n authorization?: RequestAuthorization[]\n /**\n * Http action flows.\n * In ARC this was \"actions\",\n */\n flows?: IHttpFlow[]\n /**\n * The certificate to use with the request.\n * Note, the certificate defined on the certificate authorization\n * should not be included here by default. The HTTP transport should recognize\n * this certificate and update the configuration.\n */\n clientCertificate?: Certificate\n\n /**\n * The list of assertions (tests) to perform after the response is ready.\n */\n assertions?: IHttpAssertion[]\n\n /**\n * Creates a request from an URL.\n *\n * @param url The Request URL.\n */\n\n static fromUrl(url: string): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url,\n },\n info: Thing.fromName(url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a request from a name.\n *\n * @param name The Request name.\n */\n static fromName(name: string): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName(name).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a request from an HttpRequest definition.\n *\n * @param info The request data.\n */\n static fromHttpRequest(info: IHttpRequest): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: info.method,\n url: info.url,\n headers: info.headers,\n payload: info.payload,\n },\n info: Thing.fromName(info.url).toJSON(),\n })\n return request\n }\n\n static async fromLegacy(request: ARCSavedRequest | ARCHistoryRequest): Promise<Request> {\n const normalized = Normalizer.normalizeRequest(request) as ARCSavedRequest\n if (!normalized) {\n throw new Error(`Unknown object.`)\n }\n const init: IRequest = {\n kind: Kind,\n expects: {\n kind: HttpRequestKind,\n method: normalized.method || 'GET',\n url: normalized.url || '',\n headers: normalized.headers,\n },\n info: Thing.fromName(normalized.name || 'Unnamed request').toJSON(),\n }\n init.created = normalized.created\n init.updated = normalized.updated\n if (normalized.actions) {\n init.flows = LegacyTranslator.translate(normalized.actions)\n }\n if (Array.isArray(normalized.authorization) && normalized.authorization.length) {\n init.authorization = normalized.authorization.map((i) => RequestAuthorization.fromLegacy(i).toJSON())\n }\n if (normalized.config) {\n init.config = RequestConfig.fromLegacy(normalized.config).toJSON()\n }\n if (normalized.payload) {\n init.expects.payload = await PayloadSerializer.serialize(normalized.payload)\n } else if (normalized.blob) {\n init.expects.payload = {\n type: 'blob',\n data: normalized.blob,\n }\n } else if (normalized.multipart) {\n init.expects.payload = {\n type: 'formdata',\n data: normalized.multipart,\n }\n }\n const log = new RequestLog()\n if (normalized.transportRequest) {\n const sent = await SentRequest.fromLegacy(normalized.transportRequest)\n log.request = sent\n }\n if (normalized.response) {\n const typedError = normalized.response as LegacyErrorResponse\n if (typedError.error) {\n log.response = await ErrorResponse.fromLegacy(typedError)\n } else {\n const typedResponse = normalized.response as LegacyResponse\n log.response = await Response.fromLegacy(typedResponse)\n if (Array.isArray(typedResponse.redirects) && typedResponse.redirects.length) {\n const promises = typedResponse.redirects.map((redirect) => log.addLegacyRedirect(redirect))\n await Promise.allSettled(promises)\n }\n if (typedResponse.size) {\n log.size = new RequestsSize(typedResponse.size)\n }\n }\n }\n init.log = log.toJSON()\n return new Request(init)\n }\n\n /**\n * @param value The timestamp when the request was created.\n */\n set created(value: number | undefined) {\n if (!value) {\n this[createdSymbol] = Date.now()\n } else {\n this[createdSymbol] = value\n }\n }\n\n /**\n * @returns The timestamp when the request was created.\n */\n get created(): number {\n return this[createdSymbol] || Date.now()\n }\n\n /**\n * @param value The timestamp when the request was last updated.\n */\n set updated(value: number | undefined) {\n if (!value) {\n this[updatedSymbol] = this.created\n } else {\n this[updatedSymbol] = value\n }\n const d = new Date(this[updatedSymbol])\n d.setHours(0, 0, 0, 0)\n this[midnightSymbol] = d.getTime()\n }\n\n /**\n * @returns The timestamp when the request was last updated.\n */\n get updated(): number {\n return this[updatedSymbol] || this.created\n }\n\n /**\n * @param value The timestamp of the midnight when the request object was updated\n */\n set midnight(value: number | undefined) {\n if (!value) {\n this[midnightSymbol] = this.defaultMidnight()\n } else {\n this[midnightSymbol] = value\n }\n }\n\n /**\n * @returns The timestamp of the midnight when the request object was updated\n */\n get midnight(): number {\n if (this[midnightSymbol]) {\n return this[midnightSymbol]\n }\n return this.defaultMidnight()\n }\n\n constructor(input?: string | IRequest) {\n let init: IRequest\n if (typeof input === 'string') {\n init = JSON.parse(input)\n } else if (typeof input === 'object') {\n init = input\n } else {\n const now: number = Date.now()\n init = {\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName('').toJSON(),\n }\n }\n this.new(init)\n }\n\n new(init: IRequest): void {\n const {\n expects,\n log,\n updated,\n created = Date.now(),\n midnight,\n config,\n authorization,\n flows,\n clientCertificate,\n info,\n assertions,\n } = init\n if (expects) {\n this.expects = new HttpRequest(expects)\n } else {\n this.expects = new HttpRequest()\n }\n if (info) {\n this.info = new Thing(info)\n } else {\n this.info = Thing.fromName('')\n }\n if (log) {\n this.log = new RequestLog(log)\n } else {\n this.log = undefined\n }\n if (config) {\n this.config = new RequestConfig(config)\n } else {\n this.config = undefined\n }\n if (Array.isArray(authorization)) {\n this.authorization = authorization.map((i) => new RequestAuthorization(i))\n } else {\n this.authorization = undefined\n }\n this.created = created\n if (updated) {\n this.updated = updated\n } else {\n this.updated = this.created\n }\n if (midnight) {\n this.midnight = midnight\n }\n if (Array.isArray(flows)) {\n this.flows = flows.map((i) => Json.clone(i))\n } else {\n this.flows = undefined\n }\n if (Array.isArray(assertions)) {\n this.assertions = assertions.map((i) => Json.clone(i))\n } else {\n this.assertions = undefined\n }\n if (clientCertificate) {\n this.clientCertificate = new Certificate(clientCertificate)\n } else {\n this.clientCertificate = undefined\n }\n }\n\n toJSON(): IRequest {\n const result: IRequest = {\n kind: Kind,\n expects: this.expects.toJSON(),\n info: this.info.toJSON(),\n created: this.created,\n updated: this.updated,\n midnight: this.midnight,\n }\n if (this.log) {\n result.log = this.log.toJSON()\n }\n if (this.config) {\n result.config = this.config.toJSON()\n }\n if (Array.isArray(this.authorization)) {\n result.authorization = this.authorization.map((i) => i.toJSON())\n }\n if (Array.isArray(this.flows)) {\n result.flows = this.flows.map((i) => Json.clone(i))\n }\n if (Array.isArray(this.assertions)) {\n result.assertions = this.assertions.map((i) => Json.clone(i))\n }\n if (this.clientCertificate) {\n result.clientCertificate = this.clientCertificate.toJSON()\n }\n return result\n }\n\n /**\n * Sets the basic information about a project.\n */\n setInfo(info: IThing): void {\n this.info = new Thing(info)\n this.updated = Date.now()\n }\n\n /**\n * If the info object does not exist it is being created.\n * @return The instance of an HTTP request information.\n */\n getExpects(): HttpRequest {\n if (!this.expects) {\n this.expects = new HttpRequest()\n }\n return this.expects\n }\n\n /**\n * @returns The default value for the midnight when the request was last updated.\n */\n defaultMidnight(): number {\n const d = new Date(this.updated)\n d.setHours(0, 0, 0, 0)\n return d.getTime()\n }\n\n /**\n * Reads the config from the request. If the config object does not exists it creates one.\n */\n getConfig(): RequestConfig {\n if (!this.config) {\n this.config = new RequestConfig()\n }\n return this.config\n }\n\n setLog(log: IRequestLog): void {\n const info: IRequestLog = { ...log, kind: LogKind }\n this.log = new RequestLog(info)\n this.updated = Date.now()\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../../src/models/Request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AAA;QACnD,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC3B,CAAC;CACF","sourcesContent":["import { IRequestConfig, RequestConfig } from './RequestConfig.js'\nimport { Thing, IThing } from './Thing.js'\nimport { HttpCertificate, Certificate } from './ClientCertificate.js'\nimport { IRequestAuthorization, RequestAuthorization } from './RequestAuthorization.js'\nimport { IRequestLog, RequestLog, Kind as LogKind } from './RequestLog.js'\nimport { SentRequest } from './SentRequest.js'\nimport { ErrorResponse } from './ErrorResponse.js'\nimport { Response } from './Response.js'\nimport { RequestsSize } from './RequestsSize.js'\nimport { IHttpRequest, HttpRequest, Kind as HttpRequestKind } from './HttpRequest.js'\nimport { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js'\nimport { ErrorResponse as LegacyErrorResponse, Response as LegacyResponse } from './legacy/request/ArcResponse.js'\nimport { PayloadSerializer } from '../lib/transformers/PayloadSerializer.js'\nimport { Normalizer } from './legacy/Normalizer.js'\nimport { IHttpFlow } from './http-flows/HttpFlows.js'\nimport { IHttpAssertion } from './http-flows/HttpAssertion.js'\nimport { LegacyTranslator } from './http-flows/LegacyTranslator.js'\n\nexport const Kind = 'Core#Request'\nexport const createdSymbol = Symbol('created')\nexport const updatedSymbol = Symbol('updated')\nexport const midnightSymbol = Symbol('midnight')\n\n/**\n * The definition of a request object that functions inside API Client\n * with the full configuration.\n */\nexport interface IRequest {\n kind: string\n /**\n * The basic information about the request.\n */\n info: IThing\n /**\n * The HTTP definition of the request.\n */\n expects: IHttpRequest\n /**\n * The execution log of the last HTTP request with a response.\n */\n log?: IRequestLog\n /**\n * Timestamp when the request was last updated.\n */\n updated?: number\n /**\n * Timestamp when the request was created.\n */\n created?: number\n /**\n * A timestamp of the midnight when the request object was updated\n */\n midnight?: number\n /**\n * Request processing configuration.\n */\n config?: IRequestConfig\n /**\n * Request authorization configuration\n */\n authorization?: IRequestAuthorization[]\n /**\n * Http action flows.\n * In ARC this was \"actions\",\n */\n flows?: IHttpFlow[]\n /**\n * The certificate to use with the request.\n * Note, the certificate defined on the certificate authorization\n * should not be included here by default. The HTTP transport should recognize\n * this certificate and update the configuration.\n */\n clientCertificate?: HttpCertificate\n\n /**\n * The list of assertions (tests) to perform after the response is ready.\n */\n assertions?: IHttpAssertion[]\n}\n\nexport class Request {\n [createdSymbol] = 0;\n [updatedSymbol] = 0;\n [midnightSymbol] = 0\n kind = Kind\n /**\n * The basic information about the project.\n */\n info: Thing = new Thing()\n /**\n * The HTTP definition of the request.\n */\n expects: HttpRequest = new HttpRequest()\n /**\n * The execution log of the last HTTP request with a response.\n */\n log?: RequestLog\n /**\n * Request processing configuration.\n */\n config?: RequestConfig\n /**\n * Request authorization configuration\n */\n authorization?: RequestAuthorization[]\n /**\n * Http action flows.\n * In ARC this was \"actions\",\n */\n flows?: IHttpFlow[]\n /**\n * The certificate to use with the request.\n * Note, the certificate defined on the certificate authorization\n * should not be included here by default. The HTTP transport should recognize\n * this certificate and update the configuration.\n */\n clientCertificate?: Certificate\n\n /**\n * The list of assertions (tests) to perform after the response is ready.\n */\n assertions?: IHttpAssertion[]\n\n /**\n * Creates a request from an URL.\n *\n * @param url The Request URL.\n */\n\n static fromUrl(url: string): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url,\n },\n info: Thing.fromName(url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a request from a name.\n *\n * @param name The Request name.\n */\n static fromName(name: string): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName(name).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a request from an HttpRequest definition.\n *\n * @param info The request data.\n */\n static fromHttpRequest(info: IHttpRequest): Request {\n const now: number = Date.now()\n const request = new Request({\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: info.method,\n url: info.url,\n headers: info.headers,\n payload: info.payload,\n },\n info: Thing.fromName(info.url).toJSON(),\n })\n return request\n }\n\n static async fromLegacy(request: ARCSavedRequest | ARCHistoryRequest): Promise<Request> {\n const normalized = Normalizer.normalizeRequest(request) as ARCSavedRequest\n if (!normalized) {\n throw new Error(`Unknown object.`)\n }\n const init: IRequest = {\n kind: Kind,\n expects: {\n kind: HttpRequestKind,\n method: normalized.method || 'GET',\n url: normalized.url || '',\n headers: normalized.headers,\n },\n info: Thing.fromName(normalized.name || 'Unnamed request').toJSON(),\n }\n init.created = normalized.created\n init.updated = normalized.updated\n if (normalized.actions) {\n init.flows = LegacyTranslator.translate(normalized.actions)\n }\n if (Array.isArray(normalized.authorization) && normalized.authorization.length) {\n init.authorization = normalized.authorization.map((i) => RequestAuthorization.fromLegacy(i).toJSON())\n }\n if (normalized.config) {\n init.config = RequestConfig.fromLegacy(normalized.config).toJSON()\n }\n if (normalized.payload) {\n init.expects.payload = await PayloadSerializer.serialize(normalized.payload)\n } else if (normalized.blob) {\n init.expects.payload = {\n type: 'blob',\n data: normalized.blob,\n }\n } else if (normalized.multipart) {\n init.expects.payload = {\n type: 'formdata',\n data: normalized.multipart,\n }\n }\n const log = new RequestLog()\n if (normalized.transportRequest) {\n const sent = await SentRequest.fromLegacy(normalized.transportRequest)\n log.request = sent\n }\n if (normalized.response) {\n const typedError = normalized.response as LegacyErrorResponse\n if (typedError.error) {\n log.response = await ErrorResponse.fromLegacy(typedError)\n } else {\n const typedResponse = normalized.response as LegacyResponse\n log.response = await Response.fromLegacy(typedResponse)\n if (Array.isArray(typedResponse.redirects) && typedResponse.redirects.length) {\n const promises = typedResponse.redirects.map((redirect) => log.addLegacyRedirect(redirect))\n await Promise.allSettled(promises)\n }\n if (typedResponse.size) {\n log.size = new RequestsSize(typedResponse.size)\n }\n }\n }\n init.log = log.toJSON()\n return new Request(init)\n }\n\n /**\n * @param value The timestamp when the request was created.\n */\n set created(value: number | undefined) {\n if (!value) {\n this[createdSymbol] = Date.now()\n } else {\n this[createdSymbol] = value\n }\n }\n\n /**\n * @returns The timestamp when the request was created.\n */\n get created(): number {\n return this[createdSymbol] || Date.now()\n }\n\n /**\n * @param value The timestamp when the request was last updated.\n */\n set updated(value: number | undefined) {\n if (!value) {\n this[updatedSymbol] = this.created\n } else {\n this[updatedSymbol] = value\n }\n const d = new Date(this[updatedSymbol])\n d.setHours(0, 0, 0, 0)\n this[midnightSymbol] = d.getTime()\n }\n\n /**\n * @returns The timestamp when the request was last updated.\n */\n get updated(): number {\n return this[updatedSymbol] || this.created\n }\n\n /**\n * @param value The timestamp of the midnight when the request object was updated\n */\n set midnight(value: number | undefined) {\n if (!value) {\n this[midnightSymbol] = this.defaultMidnight()\n } else {\n this[midnightSymbol] = value\n }\n }\n\n /**\n * @returns The timestamp of the midnight when the request object was updated\n */\n get midnight(): number {\n if (this[midnightSymbol]) {\n return this[midnightSymbol]\n }\n return this.defaultMidnight()\n }\n\n constructor(input?: string | IRequest) {\n let init: IRequest\n if (typeof input === 'string') {\n init = JSON.parse(input)\n } else if (typeof input === 'object') {\n init = input\n } else {\n const now: number = Date.now()\n init = {\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName('').toJSON(),\n }\n }\n this.new(init)\n }\n\n new(init: IRequest): void {\n const {\n expects,\n log,\n updated,\n created = Date.now(),\n midnight,\n config,\n authorization,\n flows,\n clientCertificate,\n info,\n assertions,\n } = init\n if (expects) {\n this.expects = new HttpRequest(expects)\n } else {\n this.expects = new HttpRequest()\n }\n if (info) {\n this.info = new Thing(info)\n } else {\n this.info = Thing.fromName('')\n }\n if (log) {\n this.log = new RequestLog(log)\n } else {\n this.log = undefined\n }\n if (config) {\n this.config = new RequestConfig(config)\n } else {\n this.config = undefined\n }\n if (Array.isArray(authorization)) {\n this.authorization = authorization.map((i) => new RequestAuthorization(i))\n } else {\n this.authorization = undefined\n }\n this.created = created\n if (updated) {\n this.updated = updated\n } else {\n this.updated = this.created\n }\n if (midnight) {\n this.midnight = midnight\n }\n if (Array.isArray(flows)) {\n this.flows = flows.map((i) => structuredClone(i))\n } else {\n this.flows = undefined\n }\n if (Array.isArray(assertions)) {\n this.assertions = assertions.map((i) => structuredClone(i))\n } else {\n this.assertions = undefined\n }\n if (clientCertificate) {\n this.clientCertificate = new Certificate(clientCertificate)\n } else {\n this.clientCertificate = undefined\n }\n }\n\n toJSON(): IRequest {\n const result: IRequest = {\n kind: Kind,\n expects: this.expects.toJSON(),\n info: this.info.toJSON(),\n created: this.created,\n updated: this.updated,\n midnight: this.midnight,\n }\n if (this.log) {\n result.log = this.log.toJSON()\n }\n if (this.config) {\n result.config = this.config.toJSON()\n }\n if (Array.isArray(this.authorization)) {\n result.authorization = this.authorization.map((i) => i.toJSON())\n }\n if (Array.isArray(this.flows)) {\n result.flows = this.flows.map((i) => structuredClone(i))\n }\n if (Array.isArray(this.assertions)) {\n result.assertions = this.assertions.map((i) => structuredClone(i))\n }\n if (this.clientCertificate) {\n result.clientCertificate = this.clientCertificate.toJSON()\n }\n return result\n }\n\n /**\n * Sets the basic information about a project.\n */\n setInfo(info: IThing): void {\n this.info = new Thing(info)\n this.updated = Date.now()\n }\n\n /**\n * If the info object does not exist it is being created.\n * @return The instance of an HTTP request information.\n */\n getExpects(): HttpRequest {\n if (!this.expects) {\n this.expects = new HttpRequest()\n }\n return this.expects\n }\n\n /**\n * @returns The default value for the midnight when the request was last updated.\n */\n defaultMidnight(): number {\n const d = new Date(this.updated)\n d.setHours(0, 0, 0, 0)\n return d.getTime()\n }\n\n /**\n * Reads the config from the request. If the config object does not exists it creates one.\n */\n getConfig(): RequestConfig {\n if (!this.config) {\n this.config = new RequestConfig()\n }\n return this.config\n }\n\n setLog(log: IRequestLog): void {\n const info: IRequestLog = { ...log, kind: LogKind }\n this.log = new RequestLog(info)\n this.updated = Date.now()\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Revision.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Revision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Revision.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Revision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,YAAY,CAAA;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD;;OAEG;IACH,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Revision.js","sourceRoot":"","sources":["../../../../src/models/store/Revision.ts"],"names":[],"mappings":"","sourcesContent":["import { Operation } from '@api-client/json'\nimport { RevisionKind } from '../kinds.js'\n\nexport interface IRevisionListItem {\n kind: typeof RevisionKind\n /**\n * The datastore key for this patch object.\n */\n id: string\n /**\n * The timestamp when the patch was created.\n */\n created: number\n /**\n * The ever incrementing revision number.\n */\n revision: number\n /**\n * A flag determining that the revision is inactive.\n * This may happen when a previous revision has been restored. This revision is then\n * detached from the latest revision tree. It can be user to move forward in the history though.\n *\n * Implementations! Revisions should be removed from the storage when a new revision has been created\n * that has diverged from the tree.\n */\n deleted?: boolean\n}\n\n/**\n * The definition of a patch revision.\n * The revision is created with the `@api-client/json` library.\n */\nexport interface IRevision extends IRevisionListItem {\n /**\n * The `@api-client/json` revisions object used to restore the previous state.\n */\n patch: Operation[]\n /**\n * The content of the document.\n * Note that the content does not include patches.\n */\n content: unknown\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Revision.js","sourceRoot":"","sources":["../../../../src/models/store/Revision.ts"],"names":[],"mappings":"","sourcesContent":["import type { Operation } from '@api-client/json/patch/types.js'\nimport { RevisionKind } from '../kinds.js'\n\nexport interface IRevisionListItem {\n kind: typeof RevisionKind\n /**\n * The datastore key for this patch object.\n */\n id: string\n /**\n * The timestamp when the patch was created.\n */\n created: number\n /**\n * The ever incrementing revision number.\n */\n revision: number\n /**\n * A flag determining that the revision is inactive.\n * This may happen when a previous revision has been restored. This revision is then\n * detached from the latest revision tree. It can be user to move forward in the history though.\n *\n * Implementations! Revisions should be removed from the storage when a new revision has been created\n * that has diverged from the tree.\n */\n deleted?: boolean\n}\n\n/**\n * The definition of a patch revision.\n * The revision is created with the `@api-client/json` library.\n */\nexport interface IRevision extends IRevisionListItem {\n /**\n * The `@api-client/json` revisions object used to restore the previous state.\n */\n patch: Operation[]\n /**\n * The content of the document.\n * Note that the content does not include patches.\n */\n content: unknown\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Operation
|
|
1
|
+
import type { Operation } from '@api-client/json/patch/types.js';
|
|
2
|
+
import { JsonDocument } from '@api-client/json/patch/json_document.js';
|
|
2
3
|
import type { MediaPatchInfo, PatchInfo } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Options for the PatchClient constructor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchClient.d.ts","sourceRoot":"","sources":["../../../src/patch/PatchClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PatchClient.d.ts","sourceRoot":"","sources":["../../../src/patch/PatchClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3D;;;;GAIG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IAChE;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;;;;OAOG;gBACS,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAO1C;;;;;OAKG;IACH,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,cAAc;CAcnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchClient.js","sourceRoot":"","sources":["../../../src/patch/PatchClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PatchClient.js","sourceRoot":"","sources":["../../../src/patch/PatchClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA4B/B;;;;;;;GAOG;AACH,MAAM,OAAO,WAA8B,SAAQ,YAAe;IAChE;;OAEG;IACH,GAAG,CAAQ;IACX;;OAEG;IACH,UAAU,CAAQ;IAElB;;;OAGG;IACH,OAAO,CAAS;IAEhB;;;;;;;OAOG;IACH,YAAY,OAA8B;QACxC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QACvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,UAAuB;QACnC,MAAM,MAAM,GAA+B;YACzC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,EAAE,EAAE,MAAM,EAAE;SACb,CAAA;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,MAAwB,CAAA;YACvC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC/B,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { Operation } from '@api-client/json/patch/types.js'\nimport { JsonDocument } from '@api-client/json/patch/json_document.js'\nimport { nanoid } from 'nanoid'\nimport type { MediaPatchInfo, PatchInfo } from './types.js'\n\n/**\n * Options for the PatchClient constructor.\n *\n * @typeParam T The type of the document being patched.\n */\nexport interface PatchClientOptions<T> {\n /**\n * The initial document. A deep copy is made internally.\n */\n document: T\n /**\n * The name of the application creating the patches.\n */\n app: string\n /**\n * The version of the application creating the patches.\n */\n appVersion: string\n /**\n * When version is required for patching, it should be set with the constructor and\n * updated whenever the document changes.\n */\n version?: number\n}\n\n/**\n * A client for managing and applying JSON patches to a document.\n * This class simplifies the process of generating, applying, and comparing patches\n * using the `@api-client/json` library. It also provides a mechanism to notify\n * listeners when the document has been changed after applying a patch.\n *\n * @typeParam T The type of the document being patched.\n */\nexport class PatchClient<T extends object> extends JsonDocument<T> {\n /**\n * The application name generating the patch. Used for tracking/debugging.\n */\n app: string\n /**\n * The application version generating the patch. Used for tracking/debugging.\n */\n appVersion: string\n\n /**\n * When version is required for patching, it should be set with the constructor and\n * updated whenever the document changes.\n */\n version?: number\n\n /**\n * Creates a new PatchClient instance.\n *\n * @param options Options for initializing the client.\n * @param options.document The initial document. A deep copy is made internally.\n * @param options.app The name of the application creating the patches.\n * @param options.appVersion The version of the application creating the patches.\n */\n constructor(options: PatchClientOptions<T>) {\n super(options.document)\n this.app = options.app\n this.appVersion = options.appVersion\n this.version = options.version\n }\n\n /**\n * Generates a patch information object.\n *\n * @param operations The patch operations to include.\n * @returns A `IPatchInfo` object containing the patch data, timestamp, app name, app version, and a unique ID.\n */\n generatePatch(operations: Operation[]): PatchInfo | MediaPatchInfo {\n const result: PatchInfo | MediaPatchInfo = {\n timestamp: Date.now(),\n patch: operations,\n app: this.app,\n appVersion: this.appVersion,\n id: nanoid(),\n }\n if (this.version !== undefined) {\n const casted = result as MediaPatchInfo\n casted.version = this.version\n }\n return result\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,KAAK,EAAE,eAAe,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;OAEG;IACH,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;OAEG;IACH,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patch/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Operation } from '@api-client/json'\nimport { AccessOperation } from '../models/store/Permission.js'\n\n/**\n * An interface describing a schema to be sent to the server\n * when making a patch of a file.\n */\nexport interface PatchInfo {\n /**\n * Auto generated by the client sending the PATCH.\n */\n id: string\n /**\n * The current timestamp.\n */\n timestamp: number\n /**\n * The patch generated by the client.\n */\n patch: Operation[]\n /**\n * The application id that generated the patch.\n * This is a string that is assigned to each application in the suite.\n * External applications need to use a constant string for their apps.\n */\n app?: string\n /**\n * The version of the application that generated the patch.\n * This can and will be used to handle potential differences between suite applications.\n */\n appVersion?: string\n}\n\n/**\n * A patch used when patching a file media.\n */\nexport interface MediaPatchInfo extends PatchInfo {\n /**\n * The version of the document that this patch was based on.\n * This is used for conflict detection.\n */\n version: number\n}\n\n/**\n * An interface describing a schema to be sent to the server\n * when making a patch with user access to a file.\n */\nexport interface AccessPatchInfo {\n /**\n * Auto generated by the client sending the PATCH.\n */\n id: string\n /**\n * The patch generated by the client.\n */\n patch: AccessOperation[]\n}\n\nexport interface PatchRevision extends PatchInfo {\n /**\n * The patch to apply to the object to revert the changes.\n */\n revert: Operation[]\n}\n\n/**\n * A schema sent by the store server in a response to the patch request.\n * It contains an information about the applied patch, the reverse operation associated with it,\n * application information, and the generated by the client patch id.\n */\nexport interface MediaPatchRevision extends MediaPatchInfo {\n /**\n * The patch to apply to the object to revert the changes.\n */\n revert: Operation[]\n /**\n * The new version number of the document after applying the patch.\n * Clients need to use this value when sending another patch.\n * If the client doesn't have the current version number, it needs to\n * refresh the document and try again.\n */\n newVersion: number\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patch/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Operation } from '@api-client/json/patch/types.js'\nimport { AccessOperation } from '../models/store/Permission.js'\n\n/**\n * An interface describing a schema to be sent to the server\n * when making a patch of a file.\n */\nexport interface PatchInfo {\n /**\n * Auto generated by the client sending the PATCH.\n */\n id: string\n /**\n * The current timestamp.\n */\n timestamp: number\n /**\n * The patch generated by the client.\n */\n patch: Operation[]\n /**\n * The application id that generated the patch.\n * This is a string that is assigned to each application in the suite.\n * External applications need to use a constant string for their apps.\n */\n app?: string\n /**\n * The version of the application that generated the patch.\n * This can and will be used to handle potential differences between suite applications.\n */\n appVersion?: string\n}\n\n/**\n * A patch used when patching a file media.\n */\nexport interface MediaPatchInfo extends PatchInfo {\n /**\n * The version of the document that this patch was based on.\n * This is used for conflict detection.\n */\n version: number\n}\n\n/**\n * An interface describing a schema to be sent to the server\n * when making a patch with user access to a file.\n */\nexport interface AccessPatchInfo {\n /**\n * Auto generated by the client sending the PATCH.\n */\n id: string\n /**\n * The patch generated by the client.\n */\n patch: AccessOperation[]\n}\n\nexport interface PatchRevision extends PatchInfo {\n /**\n * The patch to apply to the object to revert the changes.\n */\n revert: Operation[]\n}\n\n/**\n * A schema sent by the store server in a response to the patch request.\n * It contains an information about the applied patch, the reverse operation associated with it,\n * application information, and the generated by the client patch id.\n */\nexport interface MediaPatchRevision extends MediaPatchInfo {\n /**\n * The patch to apply to the object to revert the changes.\n */\n revert: Operation[]\n /**\n * The new version number of the document after applying the patch.\n * Clients need to use this value when sending another patch.\n * If the client doesn't have the current version number, it needs to\n * refresh the document and try again.\n */\n newVersion: number\n}\n"]}
|
|
@@ -41728,18 +41728,18 @@
|
|
|
41728
41728
|
"@id": "#194"
|
|
41729
41729
|
},
|
|
41730
41730
|
{
|
|
41731
|
-
"@id": "#200"
|
|
41732
|
-
},
|
|
41733
|
-
{
|
|
41734
41731
|
"@id": "#197"
|
|
41735
41732
|
},
|
|
41736
41733
|
{
|
|
41737
|
-
"@id": "#
|
|
41734
|
+
"@id": "#200"
|
|
41738
41735
|
},
|
|
41739
41736
|
{
|
|
41740
41737
|
"@id": "#203"
|
|
41741
41738
|
},
|
|
41742
41739
|
{
|
|
41740
|
+
"@id": "#206"
|
|
41741
|
+
},
|
|
41742
|
+
{
|
|
41743
41743
|
"@id": "#209"
|
|
41744
41744
|
}
|
|
41745
41745
|
],
|
|
@@ -42470,9 +42470,6 @@
|
|
|
42470
42470
|
"@id": "#219"
|
|
42471
42471
|
},
|
|
42472
42472
|
{
|
|
42473
|
-
"@id": "#219"
|
|
42474
|
-
},
|
|
42475
|
-
{
|
|
42476
42473
|
"@id": "#210"
|
|
42477
42474
|
},
|
|
42478
42475
|
{
|
|
@@ -42480,6 +42477,9 @@
|
|
|
42480
42477
|
},
|
|
42481
42478
|
{
|
|
42482
42479
|
"@id": "#216"
|
|
42480
|
+
},
|
|
42481
|
+
{
|
|
42482
|
+
"@id": "#219"
|
|
42483
42483
|
}
|
|
42484
42484
|
],
|
|
42485
42485
|
"doc:root": false,
|
|
@@ -43138,7 +43138,7 @@
|
|
|
43138
43138
|
"doc:ExternalDomainElement",
|
|
43139
43139
|
"doc:DomainElement"
|
|
43140
43140
|
],
|
|
43141
|
-
"doc:raw": "
|
|
43141
|
+
"doc:raw": "code: '5'\ndescription: 'Limited company'\n",
|
|
43142
43142
|
"core:mediaType": "application/yaml",
|
|
43143
43143
|
"sourcemaps:sources": [
|
|
43144
43144
|
{
|
|
@@ -43159,7 +43159,7 @@
|
|
|
43159
43159
|
"doc:ExternalDomainElement",
|
|
43160
43160
|
"doc:DomainElement"
|
|
43161
43161
|
],
|
|
43162
|
-
"doc:raw": "
|
|
43162
|
+
"doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
|
|
43163
43163
|
"core:mediaType": "application/yaml",
|
|
43164
43164
|
"sourcemaps:sources": [
|
|
43165
43165
|
{
|
|
@@ -43180,7 +43180,7 @@
|
|
|
43180
43180
|
"doc:ExternalDomainElement",
|
|
43181
43181
|
"doc:DomainElement"
|
|
43182
43182
|
],
|
|
43183
|
-
"doc:raw": "code: '
|
|
43183
|
+
"doc:raw": "code: 'J'\ndescription: 'Information and communication'\n",
|
|
43184
43184
|
"core:mediaType": "application/yaml",
|
|
43185
43185
|
"sourcemaps:sources": [
|
|
43186
43186
|
{
|
|
@@ -43201,7 +43201,7 @@
|
|
|
43201
43201
|
"doc:ExternalDomainElement",
|
|
43202
43202
|
"doc:DomainElement"
|
|
43203
43203
|
],
|
|
43204
|
-
"doc:raw": "code: '
|
|
43204
|
+
"doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
|
|
43205
43205
|
"core:mediaType": "application/yaml",
|
|
43206
43206
|
"sourcemaps:sources": [
|
|
43207
43207
|
{
|
|
@@ -43892,7 +43892,7 @@
|
|
|
43892
43892
|
"doc:ExternalDomainElement",
|
|
43893
43893
|
"doc:DomainElement"
|
|
43894
43894
|
],
|
|
43895
|
-
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '
|
|
43895
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
|
|
43896
43896
|
"core:mediaType": "application/yaml",
|
|
43897
43897
|
"sourcemaps:sources": [
|
|
43898
43898
|
{
|
|
@@ -43913,7 +43913,7 @@
|
|
|
43913
43913
|
"doc:ExternalDomainElement",
|
|
43914
43914
|
"doc:DomainElement"
|
|
43915
43915
|
],
|
|
43916
|
-
"doc:raw": "
|
|
43916
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
|
|
43917
43917
|
"core:mediaType": "application/yaml",
|
|
43918
43918
|
"sourcemaps:sources": [
|
|
43919
43919
|
{
|
|
@@ -43934,7 +43934,7 @@
|
|
|
43934
43934
|
"doc:ExternalDomainElement",
|
|
43935
43935
|
"doc:DomainElement"
|
|
43936
43936
|
],
|
|
43937
|
-
"doc:raw": "type:
|
|
43937
|
+
"doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
|
|
43938
43938
|
"core:mediaType": "application/yaml",
|
|
43939
43939
|
"sourcemaps:sources": [
|
|
43940
43940
|
{
|
|
@@ -43955,7 +43955,7 @@
|
|
|
43955
43955
|
"doc:ExternalDomainElement",
|
|
43956
43956
|
"doc:DomainElement"
|
|
43957
43957
|
],
|
|
43958
|
-
"doc:raw": "type:
|
|
43958
|
+
"doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
|
|
43959
43959
|
"core:mediaType": "application/yaml",
|
|
43960
43960
|
"sourcemaps:sources": [
|
|
43961
43961
|
{
|
|
@@ -44426,22 +44426,22 @@
|
|
|
44426
44426
|
{
|
|
44427
44427
|
"@id": "#199/source-map/lexical/element_0",
|
|
44428
44428
|
"sourcemaps:element": "amf://id#199",
|
|
44429
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44429
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44430
44430
|
},
|
|
44431
44431
|
{
|
|
44432
44432
|
"@id": "#202/source-map/lexical/element_0",
|
|
44433
44433
|
"sourcemaps:element": "amf://id#202",
|
|
44434
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44434
|
+
"sourcemaps:value": "[(1,0)-(5,0)]"
|
|
44435
44435
|
},
|
|
44436
44436
|
{
|
|
44437
44437
|
"@id": "#205/source-map/lexical/element_0",
|
|
44438
44438
|
"sourcemaps:element": "amf://id#205",
|
|
44439
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44439
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44440
44440
|
},
|
|
44441
44441
|
{
|
|
44442
44442
|
"@id": "#208/source-map/lexical/element_0",
|
|
44443
44443
|
"sourcemaps:element": "amf://id#208",
|
|
44444
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44444
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44445
44445
|
},
|
|
44446
44446
|
{
|
|
44447
44447
|
"@id": "#223/source-map/lexical/element_0",
|
|
@@ -44781,17 +44781,17 @@
|
|
|
44781
44781
|
{
|
|
44782
44782
|
"@id": "#215/source-map/lexical/element_0",
|
|
44783
44783
|
"sourcemaps:element": "amf://id#215",
|
|
44784
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44784
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44785
44785
|
},
|
|
44786
44786
|
{
|
|
44787
44787
|
"@id": "#218/source-map/lexical/element_0",
|
|
44788
44788
|
"sourcemaps:element": "amf://id#218",
|
|
44789
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44789
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44790
44790
|
},
|
|
44791
44791
|
{
|
|
44792
44792
|
"@id": "#221/source-map/lexical/element_0",
|
|
44793
44793
|
"sourcemaps:element": "amf://id#221",
|
|
44794
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44794
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44795
44795
|
},
|
|
44796
44796
|
{
|
|
44797
44797
|
"@id": "#338/source-map/synthesized-field/element_1",
|
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.12.
|
|
4
|
+
"version": "0.12.7",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./browser.js": {
|
|
@@ -18,36 +18,36 @@
|
|
|
18
18
|
"types": "./build/src/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./package.json": "./package.json",
|
|
21
|
-
"./amf/*": "./build/src/amf/*.js",
|
|
22
21
|
"./amf/*.js": "./build/src/amf/*.js",
|
|
23
|
-
"./
|
|
22
|
+
"./amf/*": "./build/src/amf/*",
|
|
24
23
|
"./authorization/*.js": "./build/src/authorization/*.js",
|
|
25
|
-
"./
|
|
24
|
+
"./authorization/*": "./build/src/authorization/*",
|
|
26
25
|
"./config/*.js": "./build/src/config/*.js",
|
|
27
|
-
"./
|
|
26
|
+
"./config/*": "./build/src/config/*",
|
|
28
27
|
"./cookies/*.js": "./build/src/cookies/*.js",
|
|
29
|
-
"./
|
|
28
|
+
"./cookies/*": "./build/src/cookies/*",
|
|
30
29
|
"./data/*.js": "./build/src/data/*.js",
|
|
31
|
-
"./
|
|
30
|
+
"./data/*": "./build/src/data/*",
|
|
32
31
|
"./events/*.js": "./build/src/events/*.js",
|
|
33
|
-
"./
|
|
32
|
+
"./events/*": "./build/src/events/*",
|
|
34
33
|
"./exceptions/*.js": "./build/src/exceptions/*.js",
|
|
35
|
-
"./
|
|
34
|
+
"./exceptions/*": "./build/src/exceptions/*",
|
|
36
35
|
"./lib/*.js": "./build/src/lib/*.js",
|
|
37
|
-
"./
|
|
36
|
+
"./lib/*": "./build/src/lib/*",
|
|
38
37
|
"./mocking/*.js": "./build/src/mocking/*.js",
|
|
39
|
-
"./
|
|
38
|
+
"./mocking/*": "./build/src/mocking/*",
|
|
40
39
|
"./modeling/*.js": "./build/src/modeling/*.js",
|
|
41
|
-
"./
|
|
40
|
+
"./modeling/*": "./build/src/modeling/*",
|
|
42
41
|
"./models/*.js": "./build/src/models/*.js",
|
|
43
|
-
"./
|
|
42
|
+
"./models/*": "./build/src/models/*",
|
|
44
43
|
"./patch/*.js": "./build/src/patch/*.js",
|
|
45
|
-
"./
|
|
44
|
+
"./patch/*": "./build/src/patch/*",
|
|
46
45
|
"./proxy/*.js": "./build/src/proxy/*.js",
|
|
47
|
-
"./
|
|
46
|
+
"./proxy/*": "./build/src/proxy/*",
|
|
48
47
|
"./runtime/*.js": "./build/src/runtime/*.js",
|
|
49
|
-
"./
|
|
50
|
-
"./testing/*.js": "./build/src/testing/*.js"
|
|
48
|
+
"./runtime/*": "./build/src/runtime/*",
|
|
49
|
+
"./testing/*.js": "./build/src/testing/*.js",
|
|
50
|
+
"./testing/*": "./build/src/testing/*"
|
|
51
51
|
},
|
|
52
52
|
"imports": {
|
|
53
53
|
"#amf/*": "./src/amf/*",
|
|
@@ -84,10 +84,11 @@
|
|
|
84
84
|
"@api-client/json": "^0.2.0",
|
|
85
85
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
86
86
|
"@metrichor/jmespath": "^0.3.1",
|
|
87
|
-
"@pawel-up/data-mock": "^0.
|
|
87
|
+
"@pawel-up/data-mock": "^0.4.0",
|
|
88
88
|
"@pawel-up/jexl": "^3.0.0",
|
|
89
89
|
"@xmldom/xmldom": "^0.9.7",
|
|
90
90
|
"amf-json-ld-lib": "^0.0.15",
|
|
91
|
+
"chalk": "^5.4.1",
|
|
91
92
|
"console-table-printer": "^2.11.2",
|
|
92
93
|
"nanoid": "^5.1.5",
|
|
93
94
|
"ws": "^8.12.0",
|
|
@@ -126,9 +127,9 @@
|
|
|
126
127
|
"globals": "^16.0.0",
|
|
127
128
|
"husky": "^9.0.11",
|
|
128
129
|
"jsdom": "^26.0.0",
|
|
129
|
-
"lint-staged": "^
|
|
130
|
+
"lint-staged": "^16.0.0",
|
|
130
131
|
"nock": "^14.0.1",
|
|
131
|
-
"oauth2-mock-server": "^
|
|
132
|
+
"oauth2-mock-server": "^8.0.0",
|
|
132
133
|
"playwright": "^1.50.1",
|
|
133
134
|
"prettier": "^3.5.1",
|
|
134
135
|
"sinon": "^20.0.0",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from '@pawel-up/data-mock/Types.js'
|
|
2
|
+
import { Person } from '@pawel-up/data-mock/Person.js'
|
|
3
|
+
import { Lorem } from '@pawel-up/data-mock/Lorem.js'
|
|
4
|
+
import { Time } from '@pawel-up/data-mock/Time.js'
|
|
2
5
|
import { AmfNamespace as ns } from './definitions/Namespace.js'
|
|
3
6
|
import { JsonDataNodeGenerator } from './data-node/JsonDataNodeGenerator.js'
|
|
4
7
|
import { parseBooleanInput, parseNumberInput, readTypedValue } from './Utils.js'
|
|
@@ -12,6 +15,7 @@ import {
|
|
|
12
15
|
IApiScalarShape,
|
|
13
16
|
IShapeUnion,
|
|
14
17
|
} from './definitions/Shapes.js'
|
|
18
|
+
import { ILoremWordInit, ITypeHashInit, ITypeNumberInit } from '@pawel-up/data-mock/types.js'
|
|
15
19
|
|
|
16
20
|
export interface IApiSchemaReadOptions {
|
|
17
21
|
/**
|
|
@@ -29,8 +33,9 @@ export interface IApiSchemaReadOptions {
|
|
|
29
33
|
*/
|
|
30
34
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
31
35
|
export class ApiSchemaValues {
|
|
32
|
-
static
|
|
33
|
-
|
|
36
|
+
static types = new Types()
|
|
37
|
+
static person = new Person()
|
|
38
|
+
static lorem = new Lorem()
|
|
34
39
|
/**
|
|
35
40
|
* Reads the value to be set on an input. This is for Scalar shapes only.
|
|
36
41
|
*
|
|
@@ -184,7 +189,7 @@ export class ApiSchemaValues {
|
|
|
184
189
|
return this.generateNumberValue(schema)
|
|
185
190
|
case ns.aml.vocabularies.shapes.boolean:
|
|
186
191
|
case ns.w3.xmlSchema.boolean:
|
|
187
|
-
return this.
|
|
192
|
+
return this.types.boolean()
|
|
188
193
|
case ns.aml.vocabularies.shapes.nil:
|
|
189
194
|
case ns.w3.xmlSchema.nil:
|
|
190
195
|
return null
|
|
@@ -250,7 +255,7 @@ export class ApiSchemaValues {
|
|
|
250
255
|
}
|
|
251
256
|
let generator: ((init?: number | ITypeNumberInit | undefined) => number) | undefined
|
|
252
257
|
if (format && ['float', 'double'].includes(format)) {
|
|
253
|
-
generator = this.
|
|
258
|
+
generator = this.types.float.bind(this.types)
|
|
254
259
|
} else if (format && ['uint32', 'uint64', 'fixed32', 'fixed64'].includes(format)) {
|
|
255
260
|
// these are unsigned numbers, make sure the generate anything above 0
|
|
256
261
|
init.min = 0
|
|
@@ -261,7 +266,7 @@ export class ApiSchemaValues {
|
|
|
261
266
|
|
|
262
267
|
if (!generator) {
|
|
263
268
|
// by default generate an integer
|
|
264
|
-
generator = this.
|
|
269
|
+
generator = this.types.number.bind(this.types)
|
|
265
270
|
}
|
|
266
271
|
if (typeof multipleOf === 'number') {
|
|
267
272
|
init.precision = multipleOf
|
|
@@ -274,10 +279,10 @@ export class ApiSchemaValues {
|
|
|
274
279
|
const lowerName = name.toLowerCase()
|
|
275
280
|
// we employ some heuristics to generate content based on the property name.
|
|
276
281
|
if (lowerName === 'description') {
|
|
277
|
-
return this.
|
|
282
|
+
return this.lorem.paragraph()
|
|
278
283
|
}
|
|
279
284
|
if (format === 'uuid') {
|
|
280
|
-
return this.
|
|
285
|
+
return this.types.uuid()
|
|
281
286
|
}
|
|
282
287
|
if (lowerName === 'id') {
|
|
283
288
|
const init: ITypeHashInit = { length: 12 }
|
|
@@ -287,16 +292,16 @@ export class ApiSchemaValues {
|
|
|
287
292
|
} else if (!hasMin && typeof maxLength === 'number') {
|
|
288
293
|
init.length = maxLength
|
|
289
294
|
}
|
|
290
|
-
return this.
|
|
295
|
+
return this.types.hash(init)
|
|
291
296
|
}
|
|
292
297
|
if (['name', 'fullname'].includes(lowerName)) {
|
|
293
|
-
return this.
|
|
298
|
+
return this.person.name()
|
|
294
299
|
}
|
|
295
300
|
if (lowerName === 'firstname') {
|
|
296
|
-
return this.
|
|
301
|
+
return this.person.firstName()
|
|
297
302
|
}
|
|
298
303
|
if (lowerName === 'lastname') {
|
|
299
|
-
return this.
|
|
304
|
+
return this.person.lastName()
|
|
300
305
|
}
|
|
301
306
|
// if (['zip', 'postcode', 'postalcode', 'zipcode'].includes(lowerName)) {
|
|
302
307
|
// return this.mocking.word
|
|
@@ -310,7 +315,7 @@ export class ApiSchemaValues {
|
|
|
310
315
|
init.length = maxLength
|
|
311
316
|
}
|
|
312
317
|
|
|
313
|
-
return this.
|
|
318
|
+
return this.lorem.word(init)
|
|
314
319
|
}
|
|
315
320
|
|
|
316
321
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Time } from '@pawel-up/data-mock'
|
|
1
|
+
import { Time } from '@pawel-up/data-mock/Time.js'
|
|
2
2
|
import { AmfNamespace as ns } from '../definitions/Namespace.js'
|
|
3
3
|
import { ApiSchemaValues } from '../ApiSchemaValues.js'
|
|
4
4
|
import { JsonDataNodeGenerator } from '../data-node/JsonDataNodeGenerator.js'
|