@nmshd/runtime 1.3.4 → 1.4.1
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/Runtime.js +1 -1
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/extensibility/facades/transport/AccountFacade.d.ts +3 -3
- package/dist/extensibility/facades/transport/AccountFacade.js +4 -4
- package/dist/extensibility/facades/transport/AccountFacade.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +2 -0
- package/dist/useCases/common/Schemas.js +22 -2
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/transport/account/SyncDatawallet.d.ts +5 -2
- package/dist/useCases/transport/account/SyncDatawallet.js +2 -2
- package/dist/useCases/transport/account/SyncDatawallet.js.map +1 -1
- package/dist/useCases/transport/account/SyncEverything.d.ts +5 -2
- package/dist/useCases/transport/account/SyncEverything.js +4 -4
- package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
- package/lib-web/nmshd.runtime.js +90 -52
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +3 -3
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +18 -18
- package/dist/events/transport/RelationshipChangeReceivedEvent.d.ts +0 -6
- package/dist/events/transport/RelationshipChangeReceivedEvent.js +0 -12
- package/dist/events/transport/RelationshipChangeReceivedEvent.js.map +0 -1
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -184,7 +184,7 @@ class Runtime {
|
|
|
184
184
|
const moduleConfiguration = this.runtimeConfig.modules[moduleName];
|
|
185
185
|
moduleConfiguration.name = moduleName;
|
|
186
186
|
if (!moduleConfiguration.enabled) {
|
|
187
|
-
this.logger.
|
|
187
|
+
this.logger.debug(`Skip loading module '${this.getModuleName(moduleConfiguration)}' because it is not enabled.`);
|
|
188
188
|
continue;
|
|
189
189
|
}
|
|
190
190
|
if (!moduleConfiguration.location) {
|
|
@@ -329,11 +329,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
329
329
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
330
330
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
331
331
|
exports.buildInformation = {
|
|
332
|
-
version: "1.
|
|
333
|
-
build: "
|
|
334
|
-
date: "2022-
|
|
335
|
-
commit: "
|
|
336
|
-
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.
|
|
332
|
+
version: "1.4.1",
|
|
333
|
+
build: "44",
|
|
334
|
+
date: "2022-04-22T12:46:10+00:00",
|
|
335
|
+
commit: "1b084693e1db32b70aabb77250e88aafd4f82c71",
|
|
336
|
+
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.1.1","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.15","@nmshd/content":"1.1.5","@nmshd/crypto":"1.0.8","@nmshd/transport":"1.2.0","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^2.3.2","qrcode":"1.5.0","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
337
337
|
libraries: {
|
|
338
338
|
serval: ts_serval_1.buildInformation,
|
|
339
339
|
consumption: consumption_1.buildInformation,
|
|
@@ -2480,11 +2480,11 @@ let AccountFacade = class AccountFacade {
|
|
|
2480
2480
|
async registerPushNotificationToken(request) {
|
|
2481
2481
|
return await this.registerPushNotificationTokenUseCase.execute(request);
|
|
2482
2482
|
}
|
|
2483
|
-
async syncDatawallet() {
|
|
2484
|
-
return await this.syncDatawalletUseCase.execute();
|
|
2483
|
+
async syncDatawallet(request = {}) {
|
|
2484
|
+
return await this.syncDatawalletUseCase.execute(request);
|
|
2485
2485
|
}
|
|
2486
|
-
async syncEverything() {
|
|
2487
|
-
return await this.syncEverythingUseCase.execute();
|
|
2486
|
+
async syncEverything(request = {}) {
|
|
2487
|
+
return await this.syncEverythingUseCase.execute(request);
|
|
2488
2488
|
}
|
|
2489
2489
|
async getSyncInfo() {
|
|
2490
2490
|
return await this.getSyncInfoUseCase.execute();
|
|
@@ -4239,8 +4239,8 @@ exports.JsonSchema = JsonSchema;
|
|
|
4239
4239
|
"use strict";
|
|
4240
4240
|
|
|
4241
4241
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4242
|
-
exports.
|
|
4243
|
-
exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.UpdateDeviceRequest = void 0;
|
|
4242
|
+
exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSharedItemRequest = exports.GetSharedItemsSharedWithAddressRequest = exports.GetSharedItemsSharedByAddressRequest = exports.GetSharedItemsByReferenceRequest = exports.GetSharedItemsByAddressRequest = exports.GetSharedItemsRequest = exports.GetSharedItemRequest = exports.DeleteSharedItemRequest = exports.CreateSharedItemRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.UpdateRelationshipInfoRequest = exports.GetRelationshipInfoByRelationshipRequest = exports.GetRelationshipInfoRequest = exports.DeleteRelationshipInfoByRelationshipRequest = exports.DeleteRelationshipInfoRequest = exports.CreateRelationshipInfoRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.GetHistoryByNameRequest = exports.GetAttributesRequest = exports.GetAttributeByNameRequest = exports.GetAttributeRequest = exports.DeleteAttributeByNameRequest = exports.DeleteAttributeRequest = exports.CreateAttributeRequest = exports.GetAttributesByNamesRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
|
|
4243
|
+
exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = void 0;
|
|
4244
4244
|
exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
|
|
4245
4245
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4246
4246
|
"$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
|
|
@@ -5252,6 +5252,16 @@ exports.RegisterPushNotificationTokenRequest = {
|
|
|
5252
5252
|
}
|
|
5253
5253
|
}
|
|
5254
5254
|
};
|
|
5255
|
+
exports.SyncDatawalletRequest = {
|
|
5256
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5257
|
+
"$ref": "#/definitions/SyncDatawalletRequest",
|
|
5258
|
+
"definitions": {
|
|
5259
|
+
"SyncDatawalletRequest": {
|
|
5260
|
+
"type": "object",
|
|
5261
|
+
"additionalProperties": false
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
};
|
|
5255
5265
|
exports.DownloadFileRequest = {
|
|
5256
5266
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5257
5267
|
"$ref": "#/definitions/DownloadFileRequest",
|
|
@@ -5293,6 +5303,16 @@ exports.DownloadAttachmentRequest = {
|
|
|
5293
5303
|
}
|
|
5294
5304
|
}
|
|
5295
5305
|
};
|
|
5306
|
+
exports.SyncEverythingRequest = {
|
|
5307
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5308
|
+
"$ref": "#/definitions/SyncEverythingRequest",
|
|
5309
|
+
"definitions": {
|
|
5310
|
+
"SyncEverythingRequest": {
|
|
5311
|
+
"type": "object",
|
|
5312
|
+
"additionalProperties": false
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
};
|
|
5296
5316
|
exports.CreateRelationshipChallengeRequest = {
|
|
5297
5317
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5298
5318
|
"$ref": "#/definitions/CreateRelationshipChallengeRequest",
|
|
@@ -9638,8 +9658,8 @@ let SyncDatawalletUseCase = class SyncDatawalletUseCase extends common_1.UseCase
|
|
|
9638
9658
|
super();
|
|
9639
9659
|
this.accountController = accountController;
|
|
9640
9660
|
}
|
|
9641
|
-
async executeInternal() {
|
|
9642
|
-
await this.accountController.syncDatawallet(true);
|
|
9661
|
+
async executeInternal(request) {
|
|
9662
|
+
await this.accountController.syncDatawallet(true, request.callback);
|
|
9643
9663
|
return ts_utils_1.Result.ok(undefined);
|
|
9644
9664
|
}
|
|
9645
9665
|
};
|
|
@@ -9690,11 +9710,11 @@ let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase
|
|
|
9690
9710
|
this.eventBus = eventBus;
|
|
9691
9711
|
this.logger = loggerFactory.getLogger(SyncEverythingUseCase);
|
|
9692
9712
|
}
|
|
9693
|
-
async executeInternal() {
|
|
9713
|
+
async executeInternal(request) {
|
|
9694
9714
|
if (this.currentSync) {
|
|
9695
9715
|
return await this.currentSync;
|
|
9696
9716
|
}
|
|
9697
|
-
this.currentSync = this._executeInternal();
|
|
9717
|
+
this.currentSync = this._executeInternal(request);
|
|
9698
9718
|
try {
|
|
9699
9719
|
return await this.currentSync;
|
|
9700
9720
|
}
|
|
@@ -9702,8 +9722,8 @@ let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase
|
|
|
9702
9722
|
this.currentSync = undefined;
|
|
9703
9723
|
}
|
|
9704
9724
|
}
|
|
9705
|
-
async _executeInternal() {
|
|
9706
|
-
const changedItems = await this.accountController.syncEverything();
|
|
9725
|
+
async _executeInternal(request) {
|
|
9726
|
+
const changedItems = await this.accountController.syncEverything(request.callback);
|
|
9707
9727
|
const messageDTOs = changedItems.messages.map((m) => MessageMapper_1.MessageMapper.toMessageDTO(m));
|
|
9708
9728
|
const relationshipDTOs = changedItems.relationships.map((r) => RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(r));
|
|
9709
9729
|
const eventTargetAddress = this.identityController.identity.address.toString();
|
|
@@ -19962,7 +19982,7 @@ const def = {
|
|
|
19962
19982
|
for (let i = 0; i < oneOf.length; i++) {
|
|
19963
19983
|
let sch = oneOf[i];
|
|
19964
19984
|
if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
19965
|
-
sch = compile_1.resolveRef.call(it.self, it.schemaEnv, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
|
|
19985
|
+
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
|
|
19966
19986
|
if (sch instanceof compile_1.SchemaEnv)
|
|
19967
19987
|
sch = sch.schema;
|
|
19968
19988
|
}
|
|
@@ -20259,7 +20279,8 @@ const def = {
|
|
|
20259
20279
|
if (!$data && schema.length === 0)
|
|
20260
20280
|
throw new Error("enum must have non-empty array");
|
|
20261
20281
|
const useLoop = schema.length >= it.opts.loopEnum;
|
|
20262
|
-
|
|
20282
|
+
let eql;
|
|
20283
|
+
const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));
|
|
20263
20284
|
let valid;
|
|
20264
20285
|
if (useLoop || $data) {
|
|
20265
20286
|
valid = gen.let("valid");
|
|
@@ -20275,12 +20296,12 @@ const def = {
|
|
|
20275
20296
|
cxt.pass(valid);
|
|
20276
20297
|
function loopEnum() {
|
|
20277
20298
|
gen.assign(valid, false);
|
|
20278
|
-
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${
|
|
20299
|
+
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
20279
20300
|
}
|
|
20280
20301
|
function equalCode(vSchema, i) {
|
|
20281
20302
|
const sch = schema[i];
|
|
20282
20303
|
return typeof sch === "object" && sch !== null
|
|
20283
|
-
? (0, codegen_1._) `${
|
|
20304
|
+
? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`
|
|
20284
20305
|
: (0, codegen_1._) `${data} === ${sch}`;
|
|
20285
20306
|
}
|
|
20286
20307
|
},
|
|
@@ -20454,7 +20475,7 @@ const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modul
|
|
|
20454
20475
|
const error = {
|
|
20455
20476
|
message({ keyword, schemaCode }) {
|
|
20456
20477
|
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
20457
|
-
return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode}
|
|
20478
|
+
return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;
|
|
20458
20479
|
},
|
|
20459
20480
|
params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
|
|
20460
20481
|
};
|
|
@@ -29023,6 +29044,9 @@ var Formatter = /*#__PURE__*/function () {
|
|
|
29023
29044
|
case "d":
|
|
29024
29045
|
return "day";
|
|
29025
29046
|
|
|
29047
|
+
case "w":
|
|
29048
|
+
return "week";
|
|
29049
|
+
|
|
29026
29050
|
case "M":
|
|
29027
29051
|
return "month";
|
|
29028
29052
|
|
|
@@ -29272,7 +29296,6 @@ var SystemZone = /*#__PURE__*/function (_Zone) {
|
|
|
29272
29296
|
return SystemZone;
|
|
29273
29297
|
}(Zone);
|
|
29274
29298
|
|
|
29275
|
-
RegExp("^" + ianaRegex.source + "$");
|
|
29276
29299
|
var dtfCache = {};
|
|
29277
29300
|
|
|
29278
29301
|
function makeDTF(zone) {
|
|
@@ -29285,7 +29308,8 @@ function makeDTF(zone) {
|
|
|
29285
29308
|
day: "2-digit",
|
|
29286
29309
|
hour: "2-digit",
|
|
29287
29310
|
minute: "2-digit",
|
|
29288
|
-
second: "2-digit"
|
|
29311
|
+
second: "2-digit",
|
|
29312
|
+
era: "short"
|
|
29289
29313
|
});
|
|
29290
29314
|
}
|
|
29291
29315
|
|
|
@@ -29296,34 +29320,38 @@ var typeToPos = {
|
|
|
29296
29320
|
year: 0,
|
|
29297
29321
|
month: 1,
|
|
29298
29322
|
day: 2,
|
|
29299
|
-
|
|
29300
|
-
|
|
29301
|
-
|
|
29323
|
+
era: 3,
|
|
29324
|
+
hour: 4,
|
|
29325
|
+
minute: 5,
|
|
29326
|
+
second: 6
|
|
29302
29327
|
};
|
|
29303
29328
|
|
|
29304
29329
|
function hackyOffset(dtf, date) {
|
|
29305
29330
|
var formatted = dtf.format(date).replace(/\u200E/g, ""),
|
|
29306
|
-
parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted),
|
|
29331
|
+
parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted),
|
|
29307
29332
|
fMonth = parsed[1],
|
|
29308
29333
|
fDay = parsed[2],
|
|
29309
29334
|
fYear = parsed[3],
|
|
29310
|
-
|
|
29311
|
-
|
|
29312
|
-
|
|
29313
|
-
|
|
29335
|
+
fadOrBc = parsed[4],
|
|
29336
|
+
fHour = parsed[5],
|
|
29337
|
+
fMinute = parsed[6],
|
|
29338
|
+
fSecond = parsed[7];
|
|
29339
|
+
return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
|
|
29314
29340
|
}
|
|
29315
29341
|
|
|
29316
29342
|
function partsOffset(dtf, date) {
|
|
29317
|
-
var formatted = dtf.formatToParts(date)
|
|
29318
|
-
|
|
29343
|
+
var formatted = dtf.formatToParts(date);
|
|
29344
|
+
var filled = [];
|
|
29319
29345
|
|
|
29320
29346
|
for (var i = 0; i < formatted.length; i++) {
|
|
29321
29347
|
var _formatted$i = formatted[i],
|
|
29322
29348
|
type = _formatted$i.type,
|
|
29323
|
-
value = _formatted$i.value
|
|
29324
|
-
|
|
29349
|
+
value = _formatted$i.value;
|
|
29350
|
+
var pos = typeToPos[type];
|
|
29325
29351
|
|
|
29326
|
-
if (
|
|
29352
|
+
if (type === "era") {
|
|
29353
|
+
filled[pos] = value;
|
|
29354
|
+
} else if (!isUndefined(pos)) {
|
|
29327
29355
|
filled[pos] = parseInt(value, 10);
|
|
29328
29356
|
}
|
|
29329
29357
|
}
|
|
@@ -29366,7 +29394,7 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
29366
29394
|
* @param {string} s - The string to check validity on
|
|
29367
29395
|
* @example IANAZone.isValidSpecifier("America/New_York") //=> true
|
|
29368
29396
|
* @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false
|
|
29369
|
-
* @deprecated This method returns false some valid IANA names. Use isValidZone instead
|
|
29397
|
+
* @deprecated This method returns false for some valid IANA names. Use isValidZone instead.
|
|
29370
29398
|
* @return {boolean}
|
|
29371
29399
|
*/
|
|
29372
29400
|
;
|
|
@@ -29434,15 +29462,20 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
29434
29462
|
_proto.offset = function offset(ts) {
|
|
29435
29463
|
var date = new Date(ts);
|
|
29436
29464
|
if (isNaN(date)) return NaN;
|
|
29465
|
+
var dtf = makeDTF(this.name);
|
|
29437
29466
|
|
|
29438
|
-
var
|
|
29439
|
-
_ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date),
|
|
29467
|
+
var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date),
|
|
29440
29468
|
year = _ref2[0],
|
|
29441
29469
|
month = _ref2[1],
|
|
29442
29470
|
day = _ref2[2],
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
|
|
29471
|
+
adOrBc = _ref2[3],
|
|
29472
|
+
hour = _ref2[4],
|
|
29473
|
+
minute = _ref2[5],
|
|
29474
|
+
second = _ref2[6];
|
|
29475
|
+
|
|
29476
|
+
if (adOrBc === "BC") {
|
|
29477
|
+
year = -Math.abs(year) + 1;
|
|
29478
|
+
} // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat
|
|
29446
29479
|
|
|
29447
29480
|
|
|
29448
29481
|
var adjustedHour = hour === 24 ? 0 : hour;
|
|
@@ -31159,6 +31192,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
31159
31192
|
* * `m` for minutes
|
|
31160
31193
|
* * `h` for hours
|
|
31161
31194
|
* * `d` for days
|
|
31195
|
+
* * `w` for weeks
|
|
31162
31196
|
* * `M` for months
|
|
31163
31197
|
* * `y` for years
|
|
31164
31198
|
* Notes:
|
|
@@ -31185,8 +31219,9 @@ var Duration = /*#__PURE__*/function () {
|
|
|
31185
31219
|
return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
|
|
31186
31220
|
}
|
|
31187
31221
|
/**
|
|
31188
|
-
* Returns a string representation of a Duration with all units included
|
|
31189
|
-
* To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.
|
|
31222
|
+
* Returns a string representation of a Duration with all units included.
|
|
31223
|
+
* To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.
|
|
31224
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
31190
31225
|
* @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`.
|
|
31191
31226
|
* @example
|
|
31192
31227
|
* ```js
|
|
@@ -33459,7 +33494,13 @@ function unitOutOfRange(unit, value) {
|
|
|
33459
33494
|
}
|
|
33460
33495
|
|
|
33461
33496
|
function dayOfWeek(year, month, day) {
|
|
33462
|
-
var
|
|
33497
|
+
var d = new Date(Date.UTC(year, month - 1, day));
|
|
33498
|
+
|
|
33499
|
+
if (year < 100 && year >= 0) {
|
|
33500
|
+
d.setUTCFullYear(d.getUTCFullYear() - 1900);
|
|
33501
|
+
}
|
|
33502
|
+
|
|
33503
|
+
var js = d.getUTCDay();
|
|
33463
33504
|
return js === 0 ? 7 : js;
|
|
33464
33505
|
}
|
|
33465
33506
|
|
|
@@ -33887,9 +33928,6 @@ function normalizeUnit(unit) {
|
|
|
33887
33928
|
} // this is a dumbed down version of fromObject() that runs about 60% faster
|
|
33888
33929
|
// but doesn't do any validation, makes a bunch of assumptions about what units
|
|
33889
33930
|
// are present, and so on.
|
|
33890
|
-
// this is a dumbed down version of fromObject() that runs about 60% faster
|
|
33891
|
-
// but doesn't do any validation, makes a bunch of assumptions about what units
|
|
33892
|
-
// are present, and so on.
|
|
33893
33931
|
|
|
33894
33932
|
|
|
33895
33933
|
function quickDT(obj, opts) {
|
|
@@ -34591,7 +34629,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
34591
34629
|
}
|
|
34592
34630
|
}
|
|
34593
34631
|
/**
|
|
34594
|
-
* Check if an object is
|
|
34632
|
+
* Check if an object is an instance of DateTime. Works across context boundaries
|
|
34595
34633
|
* @param {object} o
|
|
34596
34634
|
* @return {boolean}
|
|
34597
34635
|
*/
|
|
@@ -36189,7 +36227,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
36189
36227
|
}
|
|
36190
36228
|
}
|
|
36191
36229
|
|
|
36192
|
-
var VERSION = "2.3.
|
|
36230
|
+
var VERSION = "2.3.2";
|
|
36193
36231
|
|
|
36194
36232
|
exports.DateTime = DateTime;
|
|
36195
36233
|
exports.Duration = Duration;
|