@vllnt/convex-idempotency 0.1.0-canary.6abc175
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/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/client/index.d.ts +135 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +117 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.d.ts +78 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +3 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +40 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +65 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +7 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/crons.d.ts +16 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +19 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/mutations.d.ts +91 -0
- package/dist/component/mutations.d.ts.map +1 -0
- package/dist/component/mutations.js +177 -0
- package/dist/component/mutations.js.map +1 -0
- package/dist/component/queries.d.ts +9 -0
- package/dist/component/queries.d.ts.map +1 -0
- package/dist/component/queries.js +22 -0
- package/dist/component/queries.js.map +1 -0
- package/dist/component/schema.d.ts +26 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +21 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/validators.d.ts +80 -0
- package/dist/component/validators.d.ts.map +1 -0
- package/dist/component/validators.js +42 -0
- package/dist/component/validators.js.map +1 -0
- package/dist/shared.d.ts +17 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +17 -0
- package/dist/shared.js.map +1 -0
- package/package.json +96 -0
- package/src/client/index.ts +251 -0
- package/src/client/types.ts +87 -0
- package/src/component/_generated/api.ts +56 -0
- package/src/component/_generated/component.ts +67 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/convex.config.ts +9 -0
- package/src/component/crons.ts +23 -0
- package/src/component/mutations.ts +195 -0
- package/src/component/queries.ts +24 -0
- package/src/component/schema.ts +21 -0
- package/src/component/validators.ts +56 -0
- package/src/shared.ts +21 -0
- package/src/test.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated data model types.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
|
|
10
|
+
import type { GenericId } from "convex/values";
|
|
11
|
+
import schema from "../schema.js";
|
|
12
|
+
/**
|
|
13
|
+
* The names of all of your Convex tables.
|
|
14
|
+
*/
|
|
15
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
16
|
+
/**
|
|
17
|
+
* The type of a document stored in Convex.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
20
|
+
*/
|
|
21
|
+
export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
|
|
22
|
+
/**
|
|
23
|
+
* An identifier for a document in Convex.
|
|
24
|
+
*
|
|
25
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
26
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
27
|
+
*
|
|
28
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
29
|
+
*
|
|
30
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
31
|
+
* strings when type checking.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
34
|
+
*/
|
|
35
|
+
export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
|
|
36
|
+
/**
|
|
37
|
+
* A type describing your Convex data model.
|
|
38
|
+
*
|
|
39
|
+
* This type includes information about what tables you have, the type of
|
|
40
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
41
|
+
*
|
|
42
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
43
|
+
* `mutationGeneric` to make them type-safe.
|
|
44
|
+
*/
|
|
45
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
46
|
+
//# sourceMappingURL=dataModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
10
|
+
import type { DataModel } from "./dataModel.js";
|
|
11
|
+
/**
|
|
12
|
+
* Define a query in this Convex app's public API.
|
|
13
|
+
*
|
|
14
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
+
*
|
|
16
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
+
*/
|
|
19
|
+
export declare const query: QueryBuilder<DataModel, "public">;
|
|
20
|
+
/**
|
|
21
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
+
*
|
|
23
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
+
*
|
|
25
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
+
*/
|
|
28
|
+
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
29
|
+
/**
|
|
30
|
+
* Define a mutation in this Convex app's public API.
|
|
31
|
+
*
|
|
32
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
+
*
|
|
34
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
+
*/
|
|
37
|
+
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
38
|
+
/**
|
|
39
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
+
*
|
|
41
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
+
*
|
|
43
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
+
*/
|
|
46
|
+
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
47
|
+
/**
|
|
48
|
+
* Define an action in this Convex app's public API.
|
|
49
|
+
*
|
|
50
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
+
* code and code with side-effects, like calling third-party services.
|
|
52
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
+
*
|
|
55
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
+
*/
|
|
58
|
+
export declare const action: ActionBuilder<DataModel, "public">;
|
|
59
|
+
/**
|
|
60
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
+
*
|
|
62
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
+
*/
|
|
65
|
+
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
66
|
+
/**
|
|
67
|
+
* Define an HTTP action.
|
|
68
|
+
*
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
+
*
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
75
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
|
+
*/
|
|
77
|
+
export declare const httpAction: HttpActionBuilder;
|
|
78
|
+
/**
|
|
79
|
+
* A set of services for use within Convex query functions.
|
|
80
|
+
*
|
|
81
|
+
* The query context is passed as the first argument to any Convex query
|
|
82
|
+
* function run on the server.
|
|
83
|
+
*
|
|
84
|
+
* If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
|
|
85
|
+
*/
|
|
86
|
+
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
87
|
+
/**
|
|
88
|
+
* A set of services for use within Convex mutation functions.
|
|
89
|
+
*
|
|
90
|
+
* The mutation context is passed as the first argument to any Convex mutation
|
|
91
|
+
* function run on the server.
|
|
92
|
+
*
|
|
93
|
+
* If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
|
|
94
|
+
*/
|
|
95
|
+
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
96
|
+
/**
|
|
97
|
+
* A set of services for use within Convex action functions.
|
|
98
|
+
*
|
|
99
|
+
* The action context is passed as the first argument to any Convex action
|
|
100
|
+
* function run on the server.
|
|
101
|
+
*/
|
|
102
|
+
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
103
|
+
/**
|
|
104
|
+
* An interface to read from the database within Convex query functions.
|
|
105
|
+
*
|
|
106
|
+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
107
|
+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
108
|
+
* building a query.
|
|
109
|
+
*/
|
|
110
|
+
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
111
|
+
/**
|
|
112
|
+
* An interface to read from and write to the database within Convex mutation
|
|
113
|
+
* functions.
|
|
114
|
+
*
|
|
115
|
+
* Convex guarantees that all writes within a single mutation are
|
|
116
|
+
* executed atomically, so you never have to worry about partial writes leaving
|
|
117
|
+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
118
|
+
* for the guarantees Convex provides your functions.
|
|
119
|
+
*/
|
|
120
|
+
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
121
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAUvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAgB,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,SAAS,EAAE,UAAU,CACxC,CAAC;AAEvB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAmB,CAAC;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,SAAS,EAAE,UAAU,CAC3C,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAiB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,SAAS,EAAE,UAAU,CACzC,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,iBAAqC,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
11
|
+
/**
|
|
12
|
+
* Define a query in this Convex app's public API.
|
|
13
|
+
*
|
|
14
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
+
*
|
|
16
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
+
*/
|
|
19
|
+
export const query = queryGeneric;
|
|
20
|
+
/**
|
|
21
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
+
*
|
|
23
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
+
*
|
|
25
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
+
*/
|
|
28
|
+
export const internalQuery = internalQueryGeneric;
|
|
29
|
+
/**
|
|
30
|
+
* Define a mutation in this Convex app's public API.
|
|
31
|
+
*
|
|
32
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
+
*
|
|
34
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
+
*/
|
|
37
|
+
export const mutation = mutationGeneric;
|
|
38
|
+
/**
|
|
39
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
+
*
|
|
41
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
+
*
|
|
43
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
+
*/
|
|
46
|
+
export const internalMutation = internalMutationGeneric;
|
|
47
|
+
/**
|
|
48
|
+
* Define an action in this Convex app's public API.
|
|
49
|
+
*
|
|
50
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
+
* code and code with side-effects, like calling third-party services.
|
|
52
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
+
*
|
|
55
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
+
*/
|
|
58
|
+
export const action = actionGeneric;
|
|
59
|
+
/**
|
|
60
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
+
*
|
|
62
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
+
*/
|
|
65
|
+
export const internalAction = internalActionGeneric;
|
|
66
|
+
/**
|
|
67
|
+
* Define an HTTP action.
|
|
68
|
+
*
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
+
*
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
75
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
|
+
*/
|
|
77
|
+
export const httpAction = httpActionGeneric;
|
|
78
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,sDAAiC,CAAC;AAMjD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineComponent } from "convex/server";
|
|
2
|
+
const component = defineComponent("idempotency");
|
|
3
|
+
// Nest official child components here, e.g.:
|
|
4
|
+
// import sharded from "@convex-dev/sharded-counter/convex.config";
|
|
5
|
+
// component.use(sharded);
|
|
6
|
+
export default component;
|
|
7
|
+
//# sourceMappingURL=convex.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,SAAS,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;AAEjD,6CAA6C;AAC7C,mEAAmE;AACnE,0BAA0B;AAE1B,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default sweep cadence and page size for the built-in prune cron. The cron is
|
|
3
|
+
* the component's own self-healing safety net — a host that wants a different
|
|
4
|
+
* cadence drives `purge` from its own scheduler instead (the client exposes it).
|
|
5
|
+
* Convex cron definitions are static per deployment, so cadence is a documented
|
|
6
|
+
* module constant rather than a mount-time option; the page size bounds each
|
|
7
|
+
* sweep and `purge` self-reschedules until the expired tail is clean.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PRUNE_INTERVAL: {
|
|
10
|
+
readonly hours: 24;
|
|
11
|
+
};
|
|
12
|
+
/** Rows deleted per `purge` pass before the sweep self-reschedules. */
|
|
13
|
+
export declare const PRUNE_BATCH = 200;
|
|
14
|
+
declare const crons: import("convex/server").Crons;
|
|
15
|
+
export default crons;
|
|
16
|
+
//# sourceMappingURL=crons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crons.d.ts","sourceRoot":"","sources":["../../src/component/crons.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;CAAyB,CAAC;AAErD,uEAAuE;AACvE,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B,QAAA,MAAM,KAAK,+BAAa,CAAC;AAMzB,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cronJobs } from "convex/server";
|
|
2
|
+
import { api } from "./_generated/api";
|
|
3
|
+
/**
|
|
4
|
+
* Default sweep cadence and page size for the built-in prune cron. The cron is
|
|
5
|
+
* the component's own self-healing safety net — a host that wants a different
|
|
6
|
+
* cadence drives `purge` from its own scheduler instead (the client exposes it).
|
|
7
|
+
* Convex cron definitions are static per deployment, so cadence is a documented
|
|
8
|
+
* module constant rather than a mount-time option; the page size bounds each
|
|
9
|
+
* sweep and `purge` self-reschedules until the expired tail is clean.
|
|
10
|
+
*/
|
|
11
|
+
export const PRUNE_INTERVAL = { hours: 24 };
|
|
12
|
+
/** Rows deleted per `purge` pass before the sweep self-reschedules. */
|
|
13
|
+
export const PRUNE_BATCH = 200;
|
|
14
|
+
const crons = cronJobs();
|
|
15
|
+
crons.interval("idempotency:prune", PRUNE_INTERVAL, api.mutations.purge, {
|
|
16
|
+
batch: PRUNE_BATCH,
|
|
17
|
+
});
|
|
18
|
+
export default crons;
|
|
19
|
+
//# sourceMappingURL=crons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crons.js","sourceRoot":"","sources":["../../src/component/crons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,KAAK,EAAE,EAAE,EAAW,CAAC;AAErD,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AAEzB,KAAK,CAAC,QAAQ,CAAC,mBAAmB,EAAE,cAAc,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE;IACvE,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim `key` within `scope`. Time is read from the server (`Date.now()`) inside
|
|
3
|
+
* the handler — never supplied by the caller — so an adversarial clock cannot
|
|
4
|
+
* force a key to look expired or live. `inflightTtlMs` bounds the inflight lease:
|
|
5
|
+
* a crashed worker self-heals once its short lease lapses, after which the key is
|
|
6
|
+
* re-minted in place (the row id is reused, not deleted and re-inserted).
|
|
7
|
+
*
|
|
8
|
+
* **Expiry check order (intentional asymmetry):** `begin` checks expiry BEFORE
|
|
9
|
+
* the done-state. An expired done key is therefore re-minted `fresh` (the
|
|
10
|
+
* outcome's grace window has elapsed; the key behaves as never-seen). This is the
|
|
11
|
+
* correct recovery path — the done grace exists precisely to replay within the
|
|
12
|
+
* window; outside it the operation may safely re-run.
|
|
13
|
+
*
|
|
14
|
+
* @throws `ConvexError({ code: "INVALID_TTL" })` when `inflightTtlMs` is not a
|
|
15
|
+
* positive finite number (≤ 0 or non-finite would produce `expiresAt ≤ now`,
|
|
16
|
+
* immediately expiring the claim and breaking the dedup window).
|
|
17
|
+
*/
|
|
18
|
+
export declare const begin: import("convex/server").RegisteredMutation<"public", {
|
|
19
|
+
key: string;
|
|
20
|
+
scope: string;
|
|
21
|
+
inflightTtlMs: number;
|
|
22
|
+
}, Promise<{
|
|
23
|
+
state: "fresh";
|
|
24
|
+
result?: undefined;
|
|
25
|
+
expiresAt?: undefined;
|
|
26
|
+
retryAfterMs?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
state: "done";
|
|
29
|
+
result: any;
|
|
30
|
+
expiresAt?: undefined;
|
|
31
|
+
retryAfterMs?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
state: "inflight";
|
|
34
|
+
expiresAt: number;
|
|
35
|
+
retryAfterMs: number;
|
|
36
|
+
result?: undefined;
|
|
37
|
+
}>>;
|
|
38
|
+
/**
|
|
39
|
+
* Mark `key` `done`, recording `result` and extending the grace window by
|
|
40
|
+
* `doneTtlMs`. Returns a discriminated outcome so the host can detect a lost
|
|
41
|
+
* claim: `recorded: false` with `missing` (key never existed), `expired` (the
|
|
42
|
+
* inflight lease lapsed before completion), or `already_done` (a prior attempt
|
|
43
|
+
* won). When `upsertOnMissing` is set, a `missing`/`expired` key is written as
|
|
44
|
+
* `done` anyway — for hosts that would rather record the finished work than drop
|
|
45
|
+
* it. Time is server-sourced.
|
|
46
|
+
*
|
|
47
|
+
* **Expiry check order (intentional asymmetry):** `complete` checks the
|
|
48
|
+
* done-state BEFORE expiry. An expired done key therefore returns
|
|
49
|
+
* `already_done`, not `expired`. This is intentional: a worker that manages to
|
|
50
|
+
* call `complete` on a key that is already `done` — even if the done row's grace
|
|
51
|
+
* window has since lapsed — must not overwrite a prior winner's recorded outcome.
|
|
52
|
+
* The `expired` reason is reserved for inflight keys whose lease lapsed before
|
|
53
|
+
* the holder could complete; it does not apply to keys already marked done.
|
|
54
|
+
*
|
|
55
|
+
* @throws `ConvexError({ code: "INVALID_TTL" })` when `doneTtlMs` is not a
|
|
56
|
+
* positive finite number (≤ 0 or non-finite would produce `expiresAt ≤ now`,
|
|
57
|
+
* immediately expiring the done grace window on creation).
|
|
58
|
+
*/
|
|
59
|
+
export declare const complete: import("convex/server").RegisteredMutation<"public", {
|
|
60
|
+
result?: any;
|
|
61
|
+
key: string;
|
|
62
|
+
scope: string;
|
|
63
|
+
doneTtlMs: number;
|
|
64
|
+
upsertOnMissing: boolean;
|
|
65
|
+
}, Promise<{
|
|
66
|
+
recorded: true;
|
|
67
|
+
reason?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
recorded: false;
|
|
70
|
+
reason: "missing";
|
|
71
|
+
} | {
|
|
72
|
+
recorded: false;
|
|
73
|
+
reason: "already_done";
|
|
74
|
+
} | {
|
|
75
|
+
recorded: false;
|
|
76
|
+
reason: "expired";
|
|
77
|
+
}>>;
|
|
78
|
+
/**
|
|
79
|
+
* Delete up to `batch` keys whose `expiresAt < before`, oldest first via the
|
|
80
|
+
* `by_expires` index. `before` defaults to the server clock (`Date.now()`) when
|
|
81
|
+
* omitted, so the built-in cron sweeps exactly the keys expired as of the run —
|
|
82
|
+
* a caller cannot pass a future cutoff it did not compute. If a full batch was
|
|
83
|
+
* removed there may be more, so the sweep self-reschedules through
|
|
84
|
+
* `ctx.scheduler` until a short batch signals the tail is clean. Idempotent:
|
|
85
|
+
* re-running only ever removes already-expired rows.
|
|
86
|
+
*/
|
|
87
|
+
export declare const purge: import("convex/server").RegisteredMutation<"public", {
|
|
88
|
+
before?: number | undefined;
|
|
89
|
+
batch: number;
|
|
90
|
+
}, Promise<number>>;
|
|
91
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;GAsDhB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;GAgEnB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK;;;mBAoBhB,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { ConvexError, v } from "convex/values";
|
|
2
|
+
import { api } from "./_generated/api";
|
|
3
|
+
import { mutation } from "./_generated/server";
|
|
4
|
+
import { beginResult, completeResult, jsonValue } from "./validators";
|
|
5
|
+
/**
|
|
6
|
+
* Claim `key` within `scope`. Time is read from the server (`Date.now()`) inside
|
|
7
|
+
* the handler — never supplied by the caller — so an adversarial clock cannot
|
|
8
|
+
* force a key to look expired or live. `inflightTtlMs` bounds the inflight lease:
|
|
9
|
+
* a crashed worker self-heals once its short lease lapses, after which the key is
|
|
10
|
+
* re-minted in place (the row id is reused, not deleted and re-inserted).
|
|
11
|
+
*
|
|
12
|
+
* **Expiry check order (intentional asymmetry):** `begin` checks expiry BEFORE
|
|
13
|
+
* the done-state. An expired done key is therefore re-minted `fresh` (the
|
|
14
|
+
* outcome's grace window has elapsed; the key behaves as never-seen). This is the
|
|
15
|
+
* correct recovery path — the done grace exists precisely to replay within the
|
|
16
|
+
* window; outside it the operation may safely re-run.
|
|
17
|
+
*
|
|
18
|
+
* @throws `ConvexError({ code: "INVALID_TTL" })` when `inflightTtlMs` is not a
|
|
19
|
+
* positive finite number (≤ 0 or non-finite would produce `expiresAt ≤ now`,
|
|
20
|
+
* immediately expiring the claim and breaking the dedup window).
|
|
21
|
+
*/
|
|
22
|
+
export const begin = mutation({
|
|
23
|
+
args: {
|
|
24
|
+
key: v.string(),
|
|
25
|
+
scope: v.string(),
|
|
26
|
+
inflightTtlMs: v.number(),
|
|
27
|
+
},
|
|
28
|
+
returns: beginResult,
|
|
29
|
+
handler: async (ctx, args) => {
|
|
30
|
+
if (!(args.inflightTtlMs > 0 && isFinite(args.inflightTtlMs))) {
|
|
31
|
+
throw new ConvexError({
|
|
32
|
+
code: "INVALID_TTL",
|
|
33
|
+
message: "inflightTtlMs must be a positive finite number",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const now = Date.now();
|
|
37
|
+
const existing = await ctx.db
|
|
38
|
+
.query("keys")
|
|
39
|
+
.withIndex("by_scope_key", (q) => q.eq("scope", args.scope).eq("key", args.key))
|
|
40
|
+
.unique();
|
|
41
|
+
const expiresAt = now + args.inflightTtlMs;
|
|
42
|
+
if (existing === null) {
|
|
43
|
+
await ctx.db.insert("keys", {
|
|
44
|
+
key: args.key,
|
|
45
|
+
scope: args.scope,
|
|
46
|
+
status: "inflight",
|
|
47
|
+
expiresAt,
|
|
48
|
+
});
|
|
49
|
+
return { state: "fresh" };
|
|
50
|
+
}
|
|
51
|
+
if (existing.expiresAt <= now) {
|
|
52
|
+
await ctx.db.patch(existing._id, {
|
|
53
|
+
status: "inflight",
|
|
54
|
+
result: undefined,
|
|
55
|
+
expiresAt,
|
|
56
|
+
});
|
|
57
|
+
return { state: "fresh" };
|
|
58
|
+
}
|
|
59
|
+
if (existing.status === "done") {
|
|
60
|
+
return { state: "done", result: existing.result };
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
state: "inflight",
|
|
64
|
+
expiresAt: existing.expiresAt,
|
|
65
|
+
retryAfterMs: existing.expiresAt - now,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Mark `key` `done`, recording `result` and extending the grace window by
|
|
71
|
+
* `doneTtlMs`. Returns a discriminated outcome so the host can detect a lost
|
|
72
|
+
* claim: `recorded: false` with `missing` (key never existed), `expired` (the
|
|
73
|
+
* inflight lease lapsed before completion), or `already_done` (a prior attempt
|
|
74
|
+
* won). When `upsertOnMissing` is set, a `missing`/`expired` key is written as
|
|
75
|
+
* `done` anyway — for hosts that would rather record the finished work than drop
|
|
76
|
+
* it. Time is server-sourced.
|
|
77
|
+
*
|
|
78
|
+
* **Expiry check order (intentional asymmetry):** `complete` checks the
|
|
79
|
+
* done-state BEFORE expiry. An expired done key therefore returns
|
|
80
|
+
* `already_done`, not `expired`. This is intentional: a worker that manages to
|
|
81
|
+
* call `complete` on a key that is already `done` — even if the done row's grace
|
|
82
|
+
* window has since lapsed — must not overwrite a prior winner's recorded outcome.
|
|
83
|
+
* The `expired` reason is reserved for inflight keys whose lease lapsed before
|
|
84
|
+
* the holder could complete; it does not apply to keys already marked done.
|
|
85
|
+
*
|
|
86
|
+
* @throws `ConvexError({ code: "INVALID_TTL" })` when `doneTtlMs` is not a
|
|
87
|
+
* positive finite number (≤ 0 or non-finite would produce `expiresAt ≤ now`,
|
|
88
|
+
* immediately expiring the done grace window on creation).
|
|
89
|
+
*/
|
|
90
|
+
export const complete = mutation({
|
|
91
|
+
args: {
|
|
92
|
+
key: v.string(),
|
|
93
|
+
scope: v.string(),
|
|
94
|
+
result: v.optional(jsonValue),
|
|
95
|
+
doneTtlMs: v.number(),
|
|
96
|
+
upsertOnMissing: v.boolean(),
|
|
97
|
+
},
|
|
98
|
+
returns: completeResult,
|
|
99
|
+
handler: async (ctx, args) => {
|
|
100
|
+
if (!(args.doneTtlMs > 0 && isFinite(args.doneTtlMs))) {
|
|
101
|
+
throw new ConvexError({
|
|
102
|
+
code: "INVALID_TTL",
|
|
103
|
+
message: "doneTtlMs must be a positive finite number",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const now = Date.now();
|
|
107
|
+
const existing = await ctx.db
|
|
108
|
+
.query("keys")
|
|
109
|
+
.withIndex("by_scope_key", (q) => q.eq("scope", args.scope).eq("key", args.key))
|
|
110
|
+
.unique();
|
|
111
|
+
const expiresAt = now + args.doneTtlMs;
|
|
112
|
+
if (existing === null) {
|
|
113
|
+
if (args.upsertOnMissing) {
|
|
114
|
+
await ctx.db.insert("keys", {
|
|
115
|
+
key: args.key,
|
|
116
|
+
scope: args.scope,
|
|
117
|
+
status: "done",
|
|
118
|
+
result: args.result,
|
|
119
|
+
expiresAt,
|
|
120
|
+
});
|
|
121
|
+
return { recorded: true };
|
|
122
|
+
}
|
|
123
|
+
return { recorded: false, reason: "missing" };
|
|
124
|
+
}
|
|
125
|
+
if (existing.status === "done") {
|
|
126
|
+
return { recorded: false, reason: "already_done" };
|
|
127
|
+
}
|
|
128
|
+
if (existing.expiresAt <= now) {
|
|
129
|
+
if (args.upsertOnMissing) {
|
|
130
|
+
await ctx.db.patch(existing._id, {
|
|
131
|
+
status: "done",
|
|
132
|
+
result: args.result,
|
|
133
|
+
expiresAt,
|
|
134
|
+
});
|
|
135
|
+
return { recorded: true };
|
|
136
|
+
}
|
|
137
|
+
return { recorded: false, reason: "expired" };
|
|
138
|
+
}
|
|
139
|
+
await ctx.db.patch(existing._id, {
|
|
140
|
+
status: "done",
|
|
141
|
+
result: args.result,
|
|
142
|
+
expiresAt,
|
|
143
|
+
});
|
|
144
|
+
return { recorded: true };
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* Delete up to `batch` keys whose `expiresAt < before`, oldest first via the
|
|
149
|
+
* `by_expires` index. `before` defaults to the server clock (`Date.now()`) when
|
|
150
|
+
* omitted, so the built-in cron sweeps exactly the keys expired as of the run —
|
|
151
|
+
* a caller cannot pass a future cutoff it did not compute. If a full batch was
|
|
152
|
+
* removed there may be more, so the sweep self-reschedules through
|
|
153
|
+
* `ctx.scheduler` until a short batch signals the tail is clean. Idempotent:
|
|
154
|
+
* re-running only ever removes already-expired rows.
|
|
155
|
+
*/
|
|
156
|
+
export const purge = mutation({
|
|
157
|
+
args: { before: v.optional(v.number()), batch: v.number() },
|
|
158
|
+
returns: v.number(),
|
|
159
|
+
handler: async (ctx, args) => {
|
|
160
|
+
const before = args.before ?? Date.now();
|
|
161
|
+
const stale = await ctx.db
|
|
162
|
+
.query("keys")
|
|
163
|
+
.withIndex("by_expires", (q) => q.lt("expiresAt", before))
|
|
164
|
+
.take(args.batch);
|
|
165
|
+
for (const row of stale) {
|
|
166
|
+
await ctx.db.delete(row._id);
|
|
167
|
+
}
|
|
168
|
+
if (stale.length === args.batch) {
|
|
169
|
+
await ctx.scheduler.runAfter(0, api.mutations.purge, {
|
|
170
|
+
before,
|
|
171
|
+
batch: args.batch,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return stale.length;
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
//# sourceMappingURL=mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B;IACD,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;YAC9D,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,gDAAgD;aAC1D,CAAC,CAAC;QACL,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,QAAQ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