@mxpicture/gcp-functions-common 1.1.2 → 1.1.4
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/annotation/anno.head.d.ts +24 -0
- package/dist/annotation/anno.head.d.ts.map +1 -1
- package/dist/annotation/anno.head.js +24 -0
- package/dist/annotation/anno.head.js.map +1 -1
- package/dist/annotation/anno.property.d.ts +13 -0
- package/dist/annotation/anno.property.d.ts.map +1 -1
- package/dist/annotation/anno.property.js +13 -0
- package/dist/annotation/anno.property.js.map +1 -1
- package/dist/config/config.api.d.ts +24 -0
- package/dist/config/config.api.d.ts.map +1 -1
- package/dist/config/config.api.js +16 -0
- package/dist/config/config.api.js.map +1 -1
- package/dist/decorator/DecoArray.d.ts +67 -0
- package/dist/decorator/DecoArray.d.ts.map +1 -1
- package/dist/decorator/DecoArray.js +57 -0
- package/dist/decorator/DecoArray.js.map +1 -1
- package/dist/decorator/DecoBoolean.d.ts +19 -0
- package/dist/decorator/DecoBoolean.d.ts.map +1 -1
- package/dist/decorator/DecoBoolean.js +15 -0
- package/dist/decorator/DecoBoolean.js.map +1 -1
- package/dist/decorator/DecoDate.d.ts +22 -0
- package/dist/decorator/DecoDate.d.ts.map +1 -1
- package/dist/decorator/DecoDate.js +18 -0
- package/dist/decorator/DecoDate.js.map +1 -1
- package/dist/decorator/DecoNumber.d.ts +65 -0
- package/dist/decorator/DecoNumber.d.ts.map +1 -1
- package/dist/decorator/DecoNumber.js +55 -0
- package/dist/decorator/DecoNumber.js.map +1 -1
- package/dist/decorator/DecoObject.d.ts +21 -0
- package/dist/decorator/DecoObject.d.ts.map +1 -1
- package/dist/decorator/DecoObject.js +17 -0
- package/dist/decorator/DecoObject.js.map +1 -1
- package/dist/decorator/DecoProperty.d.ts +95 -0
- package/dist/decorator/DecoProperty.d.ts.map +1 -1
- package/dist/decorator/DecoProperty.js +94 -0
- package/dist/decorator/DecoProperty.js.map +1 -1
- package/dist/decorator/DecoString.d.ts +57 -0
- package/dist/decorator/DecoString.d.ts.map +1 -1
- package/dist/decorator/DecoString.js +48 -0
- package/dist/decorator/DecoString.js.map +1 -1
- package/dist/decorator/Decorator.d.ts +93 -0
- package/dist/decorator/Decorator.d.ts.map +1 -1
- package/dist/decorator/Decorator.js +74 -0
- package/dist/decorator/Decorator.js.map +1 -1
- package/dist/decorator/deco.cast.d.ts +42 -0
- package/dist/decorator/deco.cast.d.ts.map +1 -1
- package/dist/decorator/deco.cast.js +42 -0
- package/dist/decorator/deco.cast.js.map +1 -1
- package/dist/decorator/deco.enum.d.ts +37 -0
- package/dist/decorator/deco.enum.d.ts.map +1 -1
- package/dist/decorator/deco.enum.js +37 -0
- package/dist/decorator/deco.enum.js.map +1 -1
- package/dist/decorator/deco.names.d.ts +28 -0
- package/dist/decorator/deco.names.d.ts.map +1 -1
- package/dist/decorator/deco.names.js +6 -0
- package/dist/decorator/deco.names.js.map +1 -1
- package/dist/decorator/deco.paths.d.ts +20 -0
- package/dist/decorator/deco.paths.d.ts.map +1 -1
- package/dist/decorator/deco.paths.js +20 -0
- package/dist/decorator/deco.paths.js.map +1 -1
- package/dist/decorator/deco.properties.d.ts +20 -0
- package/dist/decorator/deco.properties.d.ts.map +1 -1
- package/dist/decorator/deco.properties.js +20 -0
- package/dist/decorator/deco.properties.js.map +1 -1
- package/dist/decorator/deco.routes.d.ts +10 -0
- package/dist/decorator/deco.routes.d.ts.map +1 -1
- package/dist/decorator/deco.routes.js +10 -0
- package/dist/decorator/deco.routes.js.map +1 -1
- package/dist/helper/FirebaseTimestamp.d.ts +76 -0
- package/dist/helper/FirebaseTimestamp.d.ts.map +1 -1
- package/dist/helper/FirebaseTimestamp.js +73 -0
- package/dist/helper/FirebaseTimestamp.js.map +1 -1
- package/dist/helper/helper.annotation.d.ts +10 -0
- package/dist/helper/helper.annotation.d.ts.map +1 -1
- package/dist/helper/helper.annotation.js +10 -0
- package/dist/helper/helper.annotation.js.map +1 -1
- package/dist/helper/helper.date.d.ts +23 -0
- package/dist/helper/helper.date.d.ts.map +1 -1
- package/dist/helper/helper.date.js +28 -1
- package/dist/helper/helper.date.js.map +1 -1
- package/dist/helper/helper.document.d.ts +10 -0
- package/dist/helper/helper.document.d.ts.map +1 -1
- package/dist/helper/helper.document.js +10 -0
- package/dist/helper/helper.document.js.map +1 -1
- package/dist/helper/helper.object.d.ts +7 -0
- package/dist/helper/helper.object.d.ts.map +1 -1
- package/dist/helper/helper.object.js +7 -0
- package/dist/helper/helper.object.js.map +1 -1
- package/dist/path/path.common.d.ts +48 -0
- package/dist/path/path.common.d.ts.map +1 -1
- package/dist/path/path.common.js +37 -4
- package/dist/path/path.common.js.map +1 -1
- package/dist/types/types.annotation.d.ts +28 -0
- package/dist/types/types.annotation.d.ts.map +1 -1
- package/dist/types/types.deco.common.d.ts +26 -0
- package/dist/types/types.deco.common.d.ts.map +1 -1
- package/dist/types/types.deco.property.d.ts +67 -0
- package/dist/types/types.deco.property.d.ts.map +1 -1
- package/dist/types/types.document.d.ts +29 -0
- package/dist/types/types.document.d.ts.map +1 -1
- package/dist/types/types.filter.d.ts +13 -0
- package/dist/types/types.filter.d.ts.map +1 -1
- package/dist/types/types.function.d.ts +20 -0
- package/dist/types/types.function.d.ts.map +1 -1
- package/dist/types/types.routes.d.ts +31 -0
- package/dist/types/types.routes.d.ts.map +1 -1
- package/dist/types/types.validation.d.ts +7 -0
- package/dist/types/types.validation.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.names.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IAEtB,GAAG,EAAE,M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AAC;CACtB;AAqBD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAEhB,CAAC,MAAM,SAAS,CAAC,EAAE,CAAC"}
|
|
@@ -16,5 +16,11 @@ const decoNames = {
|
|
|
16
16
|
initialFunc: undefined,
|
|
17
17
|
functionName: undefined,
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Array of all property keys defined on {@link DecoNames}.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Derived at module load time from the private `decoNames` sentinel object.
|
|
24
|
+
*/
|
|
19
25
|
export const decoNamesProperties = Object.keys(decoNames);
|
|
20
26
|
//# sourceMappingURL=deco.names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.names.js","sourceRoot":"","sources":["../../src/decorator/deco.names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deco.names.js","sourceRoot":"","sources":["../../src/decorator/deco.names.ts"],"names":[],"mappings":"AA2CA,MAAM,SAAS,GAAwB;IACrC,UAAU,EAAE,SAAU;IACtB,QAAQ,EAAE,SAAU;IACpB,aAAa,EAAE,SAAU;IACzB,aAAa,EAAE,SAAU;IACzB,wBAAwB;IACxB,GAAG,EAAE,SAAU;IACf,MAAM,EAAE,SAAU;IAClB,UAAU,EAAE,SAAU;IACtB,GAAG,EAAE,SAAU;IACf,IAAI,EAAE,SAAU;IAChB,KAAK,EAAE,SAAU;IACjB,KAAK,EAAE,SAAU;IACjB,MAAM,EAAE,SAAU;IAClB,WAAW,EAAE,SAAU;IACvB,WAAW,EAAE,SAAU;IACvB,YAAY,EAAE,SAAU;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAC5C,SAAS,CACwB,CAAC"}
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a decorator path string from its constituent parts.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The path format is `{dirPath}/{filename}={name}`. Only `.ts` and `.js`
|
|
6
|
+
* extensions (excluding `.d.ts`) are accepted.
|
|
7
|
+
*
|
|
8
|
+
* @param name - Decorator name.
|
|
9
|
+
* @param dirPath - Directory containing the source file.
|
|
10
|
+
* @param filename - Source file basename (must end with `.ts` or `.js`).
|
|
11
|
+
* @returns The composite decorator path.
|
|
12
|
+
* @throws Error if `filename` has an unsupported extension.
|
|
13
|
+
*/
|
|
1
14
|
export declare const toDecoPath: (name: string, dirPath: string, filename: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Parses a composite decorator path back into its constituent parts.
|
|
17
|
+
*
|
|
18
|
+
* @param decoPath - A path previously created by {@link toDecoPath}.
|
|
19
|
+
* @returns An object containing the `name`, `dirPath`, and `filename`.
|
|
20
|
+
* @throws Error if the path does not match the expected pattern.
|
|
21
|
+
*/
|
|
2
22
|
export declare const fromDecoPath: (decoPath: string) => {
|
|
3
23
|
name: string;
|
|
4
24
|
dirPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.paths.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.paths.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,UAAU,MAAM,KACf,MAQF,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAOnD,CAAC"}
|
|
1
|
+
{"version":3,"file":"deco.paths.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,UAAU,MAAM,KACf,MAQF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAOnD,CAAC"}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a decorator path string from its constituent parts.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The path format is `{dirPath}/{filename}={name}`. Only `.ts` and `.js`
|
|
6
|
+
* extensions (excluding `.d.ts`) are accepted.
|
|
7
|
+
*
|
|
8
|
+
* @param name - Decorator name.
|
|
9
|
+
* @param dirPath - Directory containing the source file.
|
|
10
|
+
* @param filename - Source file basename (must end with `.ts` or `.js`).
|
|
11
|
+
* @returns The composite decorator path.
|
|
12
|
+
* @throws Error if `filename` has an unsupported extension.
|
|
13
|
+
*/
|
|
1
14
|
export const toDecoPath = (name, dirPath, filename) => {
|
|
2
15
|
if ((!filename.endsWith(".ts") && !filename.endsWith(".js")) ||
|
|
3
16
|
filename.endsWith(".d.ts"))
|
|
4
17
|
throw new Error(`Expected file extensions: .ts and .js. Got: ${filename}`);
|
|
5
18
|
return `${dirPath}/${filename}=${name}`;
|
|
6
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Parses a composite decorator path back into its constituent parts.
|
|
22
|
+
*
|
|
23
|
+
* @param decoPath - A path previously created by {@link toDecoPath}.
|
|
24
|
+
* @returns An object containing the `name`, `dirPath`, and `filename`.
|
|
25
|
+
* @throws Error if the path does not match the expected pattern.
|
|
26
|
+
*/
|
|
7
27
|
export const fromDecoPath = (decoPath) => {
|
|
8
28
|
const found = decoPath.match(/^(.+)\/([a-zA-Z0-9-_+]+\.[tj]s)=([a-zA-Z0-9-_+]+)$/);
|
|
9
29
|
if (!found)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.paths.js","sourceRoot":"","sources":["../../src/decorator/deco.paths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MA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,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAgB,EACqC,EAAE;IACvD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAC1B,oDAAoD,CACrD,CAAC;IACF,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC;IACnE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -4,6 +4,26 @@ import { DecoBoolean } from "./DecoBoolean.js";
|
|
|
4
4
|
import { DecoDate } from "./DecoDate.js";
|
|
5
5
|
import { DecoNumber } from "./DecoNumber.js";
|
|
6
6
|
import { DecoString } from "./DecoString.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a typed {@link DecoProperty} instance from raw extracted data.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Dispatches on the `type` discriminator within the raw data to instantiate
|
|
12
|
+
* the correct subclass (string, number, boolean, date, or array).
|
|
13
|
+
* Object types are not yet supported and will return `null`.
|
|
14
|
+
*
|
|
15
|
+
* @param extr - The raw property data previously obtained via {@link DecoProperty.extractRaw}.
|
|
16
|
+
* @returns A reconstituted property instance, or `null` for unsupported types.
|
|
17
|
+
*/
|
|
7
18
|
export declare const createInstance: <T extends DecoPropertyBase>(extr: DecoPropertyRaw<T>) => DecoArray | DecoBoolean | DecoDate | DecoNumber | DecoString | null;
|
|
19
|
+
/**
|
|
20
|
+
* Creates typed {@link DecoProperty} instances from an array of raw extracted data.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Filters out any entries that cannot be reconstituted (unsupported types).
|
|
24
|
+
*
|
|
25
|
+
* @param extracts - Array of raw property data objects.
|
|
26
|
+
* @returns Array of reconstituted property instances.
|
|
27
|
+
*/
|
|
8
28
|
export declare const createInstances: (extracts: DecoPropertyRaw<any>[]) => (DecoArray | DecoBoolean | DecoDate | DecoNumber | DecoString)[];
|
|
9
29
|
//# sourceMappingURL=deco.properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.properties.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.properties.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,gBAAgB,EACvD,MAAM,eAAe,CAAC,CAAC,CAAC,wEAwCzB,CAAC;
|
|
1
|
+
{"version":3,"file":"deco.properties.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.properties.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,gBAAgB,EACvD,MAAM,eAAe,CAAC,CAAC,CAAC,wEAwCzB,CAAC;AAEF;;;;;;;;GAQG;AAEH,eAAO,MAAM,eAAe,GAAI,UAAU,eAAe,CAAC,GAAG,CAAC,EAAE,qEACW,CAAC"}
|
|
@@ -4,6 +4,17 @@ import { DecoBoolean } from "./DecoBoolean.js";
|
|
|
4
4
|
import { DecoDate } from "./DecoDate.js";
|
|
5
5
|
import { DecoNumber } from "./DecoNumber.js";
|
|
6
6
|
import { DecoString } from "./DecoString.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a typed {@link DecoProperty} instance from raw extracted data.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Dispatches on the `type` discriminator within the raw data to instantiate
|
|
12
|
+
* the correct subclass (string, number, boolean, date, or array).
|
|
13
|
+
* Object types are not yet supported and will return `null`.
|
|
14
|
+
*
|
|
15
|
+
* @param extr - The raw property data previously obtained via {@link DecoProperty.extractRaw}.
|
|
16
|
+
* @returns A reconstituted property instance, or `null` for unsupported types.
|
|
17
|
+
*/
|
|
7
18
|
export const createInstance = (extr) => {
|
|
8
19
|
if (extr.data.type === DecoPropertyType.string)
|
|
9
20
|
return new DecoString().setAll({
|
|
@@ -38,6 +49,15 @@ export const createInstance = (extr) => {
|
|
|
38
49
|
// });
|
|
39
50
|
return null;
|
|
40
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Creates typed {@link DecoProperty} instances from an array of raw extracted data.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Filters out any entries that cannot be reconstituted (unsupported types).
|
|
57
|
+
*
|
|
58
|
+
* @param extracts - Array of raw property data objects.
|
|
59
|
+
* @returns Array of reconstituted property instances.
|
|
60
|
+
*/
|
|
41
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
62
|
export const createInstances = (extracts) => extracts.map(createInstance).filter((s) => s !== null && s !== undefined);
|
|
43
63
|
//# sourceMappingURL=deco.properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.properties.js","sourceRoot":"","sources":["../../src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|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { DecoRouteParams } from "../types/types.deco.common.js";
|
|
2
2
|
import { CrudRouteName } from "./deco.enum.js";
|
|
3
|
+
/**
|
|
4
|
+
* Generates a complete set of standard CRUD route parameter definitions for a document type.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Produces routes for create, update, delete, get, query, count, and exists
|
|
8
|
+
* operations, with request/response type strings that reference the given document name.
|
|
9
|
+
*
|
|
10
|
+
* @param docName - The document type name (e.g. `"MyEntityDoc"`).
|
|
11
|
+
* @returns A record mapping each {@link CrudRouteName} to its {@link DecoRouteParams}.
|
|
12
|
+
*/
|
|
3
13
|
export declare const crudRoutes: (docName: string) => Record<CrudRouteName, DecoRouteParams>;
|
|
4
14
|
//# sourceMappingURL=deco.routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.routes.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,KACd,MAAM,CAAC,aAAa,EAAE,eAAe,CAoBtC,CAAC"}
|
|
1
|
+
{"version":3,"file":"deco.routes.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,KACd,MAAM,CAAC,aAAa,EAAE,eAAe,CAoBtC,CAAC"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a complete set of standard CRUD route parameter definitions for a document type.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Produces routes for create, update, delete, get, query, count, and exists
|
|
6
|
+
* operations, with request/response type strings that reference the given document name.
|
|
7
|
+
*
|
|
8
|
+
* @param docName - The document type name (e.g. `"MyEntityDoc"`).
|
|
9
|
+
* @returns A record mapping each {@link CrudRouteName} to its {@link DecoRouteParams}.
|
|
10
|
+
*/
|
|
1
11
|
export const crudRoutes = (docName) => ({
|
|
2
12
|
create: {
|
|
3
13
|
requestType: `WithoutKey<${docName}>`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.routes.js","sourceRoot":"","sources":["../../src/decorator/deco.routes.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,OAAe,EACyB,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE;QACN,WAAW,EAAE,cAAc,OAAO,GAAG;QACrC,YAAY,EAAE,WAAW,OAAO,GAAG;KACpC;IACD,MAAM,EAAE;QACN,WAAW,EAAE,mBAAmB,OAAO,IAAI;QAC3C,YAAY,EAAE,WAAW,OAAO,GAAG;KACpC;IACD,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE;IACzE,GAAG,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,OAAO,GAAG,EAAE;IACxE,KAAK,EAAE;QACL,WAAW,EAAE,sCAAsC;QACnD,YAAY,EAAE,WAAW,OAAO,KAAK;KACtC;IACD,KAAK,EAAE;QACL,WAAW,EAAE,sCAAsC;QACnD,YAAY,EAAE,mBAAmB;KAClC;IACD,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE;CAC5E,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"deco.routes.js","sourceRoot":"","sources":["../../src/decorator/deco.routes.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,OAAe,EACyB,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE;QACN,WAAW,EAAE,cAAc,OAAO,GAAG;QACrC,YAAY,EAAE,WAAW,OAAO,GAAG;KACpC;IACD,MAAM,EAAE;QACN,WAAW,EAAE,mBAAmB,OAAO,IAAI;QAC3C,YAAY,EAAE,WAAW,OAAO,GAAG;KACpC;IACD,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE;IACzE,GAAG,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,OAAO,GAAG,EAAE;IACxE,KAAK,EAAE;QACL,WAAW,EAAE,sCAAsC;QACnD,YAAY,EAAE,WAAW,OAAO,KAAK;KACtC;IACD,KAAK,EAAE;QACL,WAAW,EAAE,sCAAsC;QACnD,YAAY,EAAE,mBAAmB;KAClC;IACD,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE;CAC5E,CAAC,CAAC"}
|
|
@@ -1,21 +1,97 @@
|
|
|
1
1
|
import { DocumentData } from "../types/types.document.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raw serialized representation of a Firebase Timestamp.
|
|
4
|
+
*/
|
|
2
5
|
export interface FirebaseTimestampRaw {
|
|
6
|
+
/** Whole seconds of the timestamp. */
|
|
3
7
|
_seconds: number;
|
|
8
|
+
/** Sub-second nanosecond component of the timestamp. */
|
|
4
9
|
_nanoseconds: number;
|
|
5
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Immutable representation of a Firebase Timestamp with second and nanosecond precision.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Provides utilities to convert between JavaScript `Date`, millisecond epoch,
|
|
16
|
+
* raw document data, and the internal seconds/nanoseconds representation used by Firestore.
|
|
17
|
+
*/
|
|
6
18
|
export declare class FirebaseTimestamp {
|
|
7
19
|
protected readonly _seconds: number;
|
|
8
20
|
protected readonly _nanoseconds: number;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a {@link FirebaseTimestamp} representing the current moment.
|
|
23
|
+
*
|
|
24
|
+
* @returns A new `FirebaseTimestamp` for the current time.
|
|
25
|
+
*/
|
|
9
26
|
static now(): FirebaseTimestamp;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a {@link FirebaseTimestamp} from raw Firestore document data.
|
|
29
|
+
*
|
|
30
|
+
* @param doc - Document data containing `_seconds` and `_nanoseconds` fields.
|
|
31
|
+
* @returns A `FirebaseTimestamp` instance, or `null` if the fields are missing or not numeric.
|
|
32
|
+
*/
|
|
10
33
|
static fromDoc(doc: DocumentData): FirebaseTimestamp | null;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a {@link FirebaseTimestamp} from a JavaScript `Date` object.
|
|
36
|
+
*
|
|
37
|
+
* @param date - The `Date` to convert.
|
|
38
|
+
* @returns A new `FirebaseTimestamp` representing the same point in time.
|
|
39
|
+
*/
|
|
11
40
|
static fromDate(date: Date): FirebaseTimestamp;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a {@link FirebaseTimestamp} from a ISO string.
|
|
43
|
+
*
|
|
44
|
+
* @param iso - The ISO string to convert.
|
|
45
|
+
* @returns A new `FirebaseTimestamp` representing the same point in time.
|
|
46
|
+
*/
|
|
47
|
+
static fromIso(iso: string): FirebaseTimestamp;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a {@link FirebaseTimestamp} from a Unix epoch value in milliseconds.
|
|
50
|
+
*
|
|
51
|
+
* @param milliseconds - Milliseconds since the Unix epoch.
|
|
52
|
+
* @returns A new `FirebaseTimestamp` representing the given epoch.
|
|
53
|
+
*/
|
|
12
54
|
static fromMillis(milliseconds: number): FirebaseTimestamp;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new {@link FirebaseTimestamp}.
|
|
57
|
+
*
|
|
58
|
+
* @param seconds - Whole seconds of the timestamp.
|
|
59
|
+
* @param nanoseconds - Sub-second nanosecond component.
|
|
60
|
+
*/
|
|
13
61
|
constructor(seconds: number, nanoseconds: number);
|
|
62
|
+
/**
|
|
63
|
+
* Returns the raw serialized form of this timestamp.
|
|
64
|
+
*/
|
|
14
65
|
get raw(): FirebaseTimestampRaw;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the whole seconds component of this timestamp.
|
|
68
|
+
*/
|
|
15
69
|
get seconds(): number;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the nanosecond component of this timestamp.
|
|
72
|
+
*/
|
|
16
73
|
get nanoseconds(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Converts this timestamp to a JavaScript `Date`.
|
|
76
|
+
*
|
|
77
|
+
* @returns A `Date` representing the same point in time.
|
|
78
|
+
*/
|
|
17
79
|
date(): Date;
|
|
80
|
+
/**
|
|
81
|
+
* Converts this timestamp to a Unix epoch value in milliseconds.
|
|
82
|
+
*
|
|
83
|
+
* @returns The number of milliseconds since the Unix epoch.
|
|
84
|
+
*/
|
|
18
85
|
millis(): number;
|
|
86
|
+
/**
|
|
87
|
+
* Returns a sortable string representation of this timestamp.
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* The seconds are offset by the minimum allowed value and zero-padded so that
|
|
91
|
+
* lexicographic ordering matches chronological ordering.
|
|
92
|
+
*
|
|
93
|
+
* @returns A formatted string in the form `"SSSSSSSSSSSS.NNNNNNNNN"`.
|
|
94
|
+
*/
|
|
19
95
|
valueOf(): string;
|
|
20
96
|
}
|
|
21
97
|
//# sourceMappingURL=FirebaseTimestamp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseTimestamp.d.ts","sourceRoot":"","sources":["../../src/helper/FirebaseTimestamp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,qBAAa,iBAAiB;IA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,118 @@
|
|
|
1
1
|
const MS_TO_NANOS = 1000000;
|
|
2
2
|
const MIN_SECONDS = -62135596800;
|
|
3
3
|
// const MAX_SECONDS = 253402300799;
|
|
4
|
+
/**
|
|
5
|
+
* Immutable representation of a Firebase Timestamp with second and nanosecond precision.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Provides utilities to convert between JavaScript `Date`, millisecond epoch,
|
|
9
|
+
* raw document data, and the internal seconds/nanoseconds representation used by Firestore.
|
|
10
|
+
*/
|
|
4
11
|
export class FirebaseTimestamp {
|
|
5
12
|
_seconds;
|
|
6
13
|
_nanoseconds;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a {@link FirebaseTimestamp} representing the current moment.
|
|
16
|
+
*
|
|
17
|
+
* @returns A new `FirebaseTimestamp` for the current time.
|
|
18
|
+
*/
|
|
7
19
|
static now() {
|
|
8
20
|
return FirebaseTimestamp.fromMillis(Date.now());
|
|
9
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a {@link FirebaseTimestamp} from raw Firestore document data.
|
|
24
|
+
*
|
|
25
|
+
* @param doc - Document data containing `_seconds` and `_nanoseconds` fields.
|
|
26
|
+
* @returns A `FirebaseTimestamp` instance, or `null` if the fields are missing or not numeric.
|
|
27
|
+
*/
|
|
10
28
|
static fromDoc(doc) {
|
|
11
29
|
if (typeof doc._seconds !== "number" ||
|
|
12
30
|
typeof doc._nanoseconds !== "number")
|
|
13
31
|
return null;
|
|
14
32
|
return new FirebaseTimestamp(doc._seconds, doc._nanoseconds);
|
|
15
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a {@link FirebaseTimestamp} from a JavaScript `Date` object.
|
|
36
|
+
*
|
|
37
|
+
* @param date - The `Date` to convert.
|
|
38
|
+
* @returns A new `FirebaseTimestamp` representing the same point in time.
|
|
39
|
+
*/
|
|
16
40
|
static fromDate(date) {
|
|
17
41
|
return FirebaseTimestamp.fromMillis(date.getTime());
|
|
18
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a {@link FirebaseTimestamp} from a ISO string.
|
|
45
|
+
*
|
|
46
|
+
* @param iso - The ISO string to convert.
|
|
47
|
+
* @returns A new `FirebaseTimestamp` representing the same point in time.
|
|
48
|
+
*/
|
|
49
|
+
static fromIso(iso) {
|
|
50
|
+
return FirebaseTimestamp.fromDate(new Date(iso));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates a {@link FirebaseTimestamp} from a Unix epoch value in milliseconds.
|
|
54
|
+
*
|
|
55
|
+
* @param milliseconds - Milliseconds since the Unix epoch.
|
|
56
|
+
* @returns A new `FirebaseTimestamp` representing the given epoch.
|
|
57
|
+
*/
|
|
19
58
|
static fromMillis(milliseconds) {
|
|
20
59
|
const seconds = Math.floor(milliseconds / 1000);
|
|
21
60
|
const nanos = Math.floor((milliseconds - seconds * 1000) * MS_TO_NANOS);
|
|
22
61
|
return new FirebaseTimestamp(seconds, nanos);
|
|
23
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new {@link FirebaseTimestamp}.
|
|
65
|
+
*
|
|
66
|
+
* @param seconds - Whole seconds of the timestamp.
|
|
67
|
+
* @param nanoseconds - Sub-second nanosecond component.
|
|
68
|
+
*/
|
|
24
69
|
constructor(seconds, nanoseconds) {
|
|
25
70
|
this._seconds = seconds;
|
|
26
71
|
this._nanoseconds = nanoseconds;
|
|
27
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the raw serialized form of this timestamp.
|
|
75
|
+
*/
|
|
28
76
|
get raw() {
|
|
29
77
|
return { _nanoseconds: this._nanoseconds, _seconds: this._seconds };
|
|
30
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns the whole seconds component of this timestamp.
|
|
81
|
+
*/
|
|
31
82
|
get seconds() {
|
|
32
83
|
return this._seconds;
|
|
33
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Returns the nanosecond component of this timestamp.
|
|
87
|
+
*/
|
|
34
88
|
get nanoseconds() {
|
|
35
89
|
return this._nanoseconds;
|
|
36
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Converts this timestamp to a JavaScript `Date`.
|
|
93
|
+
*
|
|
94
|
+
* @returns A `Date` representing the same point in time.
|
|
95
|
+
*/
|
|
37
96
|
date() {
|
|
38
97
|
return new Date(this._seconds * 1000 + Math.round(this._nanoseconds / MS_TO_NANOS));
|
|
39
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Converts this timestamp to a Unix epoch value in milliseconds.
|
|
101
|
+
*
|
|
102
|
+
* @returns The number of milliseconds since the Unix epoch.
|
|
103
|
+
*/
|
|
40
104
|
millis() {
|
|
41
105
|
return this._seconds * 1000 + Math.floor(this._nanoseconds / MS_TO_NANOS);
|
|
42
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns a sortable string representation of this timestamp.
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* The seconds are offset by the minimum allowed value and zero-padded so that
|
|
112
|
+
* lexicographic ordering matches chronological ordering.
|
|
113
|
+
*
|
|
114
|
+
* @returns A formatted string in the form `"SSSSSSSSSSSS.NNNNNNNNN"`.
|
|
115
|
+
*/
|
|
43
116
|
valueOf() {
|
|
44
117
|
const adjustedSeconds = this.seconds - MIN_SECONDS;
|
|
45
118
|
const formattedSeconds = String(adjustedSeconds).padStart(12, "0");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseTimestamp.js","sourceRoot":"","sources":["../../src/helper/FirebaseTimestamp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FirebaseTimestamp.js","sourceRoot":"","sources":["../../src/helper/FirebaseTimestamp.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,CAAC,WAAW,CAAC;AACjC,oCAAoC;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACT,QAAQ,CAAS;IACjB,YAAY,CAAS;IA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,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,CACnE,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACI,OAAO;QACZ,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;QACnD,MAAM,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACvE,OAAO,gBAAgB,GAAG,GAAG,GAAG,oBAAoB,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { AnnotationsProperty } from "../types/types.annotation.js";
|
|
2
2
|
import { DecoPropertyBase } from "../types/types.deco.property.js";
|
|
3
3
|
import { DocumentData } from "../types/types.document.js";
|
|
4
|
+
/**
|
|
5
|
+
* Builds a partial document pre-filled with default values from annotation properties.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Iterates over the supplied annotation properties and copies any non-nullish
|
|
9
|
+
* `default` value into the resulting object.
|
|
10
|
+
*
|
|
11
|
+
* @param properties - The annotation property descriptors to extract defaults from.
|
|
12
|
+
* @returns A partial document containing only the properties that define a default value.
|
|
13
|
+
*/
|
|
4
14
|
export declare const annoDocInitial: <T extends DocumentData>(properties: AnnotationsProperty<DecoPropertyBase>[]) => Partial<T>;
|
|
5
15
|
//# sourceMappingURL=helper.annotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.annotation.d.ts","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,YAAY,EACnD,YAAY,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAClD,OAAO,CAAC,CAAC,CAUX,CAAC"}
|
|
1
|
+
{"version":3,"file":"helper.annotation.d.ts","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,YAAY,EACnD,YAAY,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAClD,OAAO,CAAC,CAAC,CAUX,CAAC"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a partial document pre-filled with default values from annotation properties.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Iterates over the supplied annotation properties and copies any non-nullish
|
|
6
|
+
* `default` value into the resulting object.
|
|
7
|
+
*
|
|
8
|
+
* @param properties - The annotation property descriptors to extract defaults from.
|
|
9
|
+
* @returns A partial document containing only the properties that define a default value.
|
|
10
|
+
*/
|
|
1
11
|
export const annoDocInitial = (properties) => {
|
|
2
12
|
const result = {};
|
|
3
13
|
for (const prop of properties) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.annotation.js","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,UAAmD,EACvC,EAAE;IACd,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAsB,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;YACnC,8DAA8D;YAC7D,MAAc,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"helper.annotation.js","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,UAAmD,EACvC,EAAE;IACd,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAsB,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;YACnC,8DAA8D;YAC7D,MAAc,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deeply converts Firestore timestamp fields to JavaScript `Date` objects.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Path segments are separated by "/" and a wildcard may be used
|
|
6
|
+
* to iterate over array elements (e.g. "items/{wildcard}/createdAt").
|
|
7
|
+
*
|
|
8
|
+
* @param data - The data structure to transform (cloned before mutation).
|
|
9
|
+
* @param paths - Slash-delimited paths to fields that should be converted.
|
|
10
|
+
* @returns A deep clone of `data` with the targeted fields converted to `Date`.
|
|
11
|
+
*/
|
|
1
12
|
export declare const toDatesDeep: <T>(data: T, paths: string[]) => T;
|
|
13
|
+
/**
|
|
14
|
+
* Deeply converts date-like fields to raw {@link FirebaseTimestampRaw} objects.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Accepts JavaScript `Date` objects, numeric millisecond values, and Firestore
|
|
18
|
+
* document objects with `_seconds`/`_nanoseconds` fields. Path segments follow
|
|
19
|
+
* the same convention as {@link toDatesDeep}.
|
|
20
|
+
*
|
|
21
|
+
* @param data - The data structure to transform (cloned before mutation).
|
|
22
|
+
* @param paths - Slash-delimited paths to fields that should be converted.
|
|
23
|
+
* @returns A deep clone of `data` with the targeted fields converted to {@link FirebaseTimestampRaw}.
|
|
24
|
+
*/
|
|
2
25
|
export declare const toTimestampsDeep: <T>(data: T, paths: string[]) => T;
|
|
3
26
|
//# sourceMappingURL=helper.date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.date.d.ts","sourceRoot":"","sources":["../../src/helper/helper.date.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.date.d.ts","sourceRoot":"","sources":["../../src/helper/helper.date.ts"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,MAAM,EAAE,KAAG,CACf,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,MAAM,EAAE,KAAG,CACf,CAAC"}
|
|
@@ -5,7 +5,9 @@ const _normalizeDate = (value) => !value
|
|
|
5
5
|
? value.toDate()
|
|
6
6
|
: value?._seconds !== undefined
|
|
7
7
|
? new Date(value._seconds * 1000 + value._nanoseconds / 1e6)
|
|
8
|
-
: value
|
|
8
|
+
: typeof value === "string"
|
|
9
|
+
? new Date(value)
|
|
10
|
+
: value;
|
|
9
11
|
const _normalizeTimestamp = (value) => {
|
|
10
12
|
if (value instanceof Date)
|
|
11
13
|
return FirebaseTimestamp.fromDate(value).raw;
|
|
@@ -13,6 +15,8 @@ const _normalizeTimestamp = (value) => {
|
|
|
13
15
|
return FirebaseTimestamp.fromMillis(value).raw;
|
|
14
16
|
if (typeof value === "object")
|
|
15
17
|
return FirebaseTimestamp.fromDoc(value)?.raw ?? null;
|
|
18
|
+
if (typeof value === "string")
|
|
19
|
+
return FirebaseTimestamp.fromIso(value).raw;
|
|
16
20
|
return null;
|
|
17
21
|
};
|
|
18
22
|
const _applyPath = (
|
|
@@ -42,6 +46,29 @@ const _convertDeep = (data, paths, convert) => {
|
|
|
42
46
|
_applyPath(clone, path.split("/"), convert);
|
|
43
47
|
return clone;
|
|
44
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Deeply converts Firestore timestamp fields to JavaScript `Date` objects.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Path segments are separated by "/" and a wildcard may be used
|
|
54
|
+
* to iterate over array elements (e.g. "items/{wildcard}/createdAt").
|
|
55
|
+
*
|
|
56
|
+
* @param data - The data structure to transform (cloned before mutation).
|
|
57
|
+
* @param paths - Slash-delimited paths to fields that should be converted.
|
|
58
|
+
* @returns A deep clone of `data` with the targeted fields converted to `Date`.
|
|
59
|
+
*/
|
|
45
60
|
export const toDatesDeep = (data, paths) => _convertDeep(data, paths, _normalizeDate);
|
|
61
|
+
/**
|
|
62
|
+
* Deeply converts date-like fields to raw {@link FirebaseTimestampRaw} objects.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Accepts JavaScript `Date` objects, numeric millisecond values, and Firestore
|
|
66
|
+
* document objects with `_seconds`/`_nanoseconds` fields. Path segments follow
|
|
67
|
+
* the same convention as {@link toDatesDeep}.
|
|
68
|
+
*
|
|
69
|
+
* @param data - The data structure to transform (cloned before mutation).
|
|
70
|
+
* @param paths - Slash-delimited paths to fields that should be converted.
|
|
71
|
+
* @returns A deep clone of `data` with the targeted fields converted to {@link FirebaseTimestampRaw}.
|
|
72
|
+
*/
|
|
46
73
|
export const toTimestampsDeep = (data, paths) => _convertDeep(data, paths, _normalizeTimestamp);
|
|
47
74
|
//# sourceMappingURL=helper.date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.date.js","sourceRoot":"","sources":["../../src/helper/helper.date.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAKhC,MAAM,cAAc,GAAgB,CAAC,KAAK,EAAE,EAAE,CAC5C,CAAC,KAAK;IACJ,CAAC,CAAC,KAAK;IACP,CAAC,CAAC,OAAO,KAAK,EAAE,MAAM,KAAK,UAAU;QACnC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;QAChB,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,SAAS;YAC7B,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC,YAAY,GAAG,GAAG,CAAC;YAC5D,CAAC,CAAC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"helper.date.js","sourceRoot":"","sources":["../../src/helper/helper.date.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAKhC,MAAM,cAAc,GAAgB,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AAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { DocumentKeyAdmin } from "../types/types.document.js";
|
|
2
|
+
/**
|
|
3
|
+
* Template object whose keys represent the administrative fields of a Firestore document.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The values are intentionally `undefined!` — this object is used only to
|
|
7
|
+
* derive the set of admin key names via {@link DOCUMENT_KEY_ADMIN_KEYS}.
|
|
8
|
+
*/
|
|
2
9
|
export declare const documentKeyAdmin: Required<DocumentKeyAdmin>;
|
|
10
|
+
/**
|
|
11
|
+
* Array of administrative document field names (`id`, `createTime`, `updateTime`).
|
|
12
|
+
*/
|
|
3
13
|
export declare const DOCUMENT_KEY_ADMIN_KEYS: string[];
|
|
4
14
|
//# sourceMappingURL=helper.document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.document.d.ts","sourceRoot":"","sources":["../../src/helper/helper.document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAIvD,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"helper.document.d.ts","sourceRoot":"","sources":["../../src/helper/helper.document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAIvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,UAAgC,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template object whose keys represent the administrative fields of a Firestore document.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The values are intentionally `undefined!` — this object is used only to
|
|
6
|
+
* derive the set of admin key names via {@link DOCUMENT_KEY_ADMIN_KEYS}.
|
|
7
|
+
*/
|
|
1
8
|
export const documentKeyAdmin = {
|
|
2
9
|
id: undefined,
|
|
3
10
|
createTime: undefined,
|
|
4
11
|
updateTime: undefined,
|
|
5
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Array of administrative document field names (`id`, `createTime`, `updateTime`).
|
|
15
|
+
*/
|
|
6
16
|
export const DOCUMENT_KEY_ADMIN_KEYS = Object.keys(documentKeyAdmin);
|
|
7
17
|
//# sourceMappingURL=helper.document.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.document.js","sourceRoot":"","sources":["../../src/helper/helper.document.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,EAAE,EAAE,SAAU;IACd,UAAU,EAAE,SAAU;IACtB,UAAU,EAAE,SAAU;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"helper.document.js","sourceRoot":"","sources":["../../src/helper/helper.document.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,EAAE,EAAE,SAAU;IACd,UAAU,EAAE,SAAU;IACtB,UAAU,EAAE,SAAU;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC"}
|