@adobe/data 0.5.8 → 0.5.10
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/ecs/database/create-database.js +68 -71
- package/dist/ecs/database/create-database.js.map +1 -1
- package/dist/ecs/database/database.d.ts +1 -1
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +3 -3
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -96,87 +96,84 @@ export function createDatabase(store, transactionDeclarations) {
|
|
|
96
96
|
notifyObservers(result);
|
|
97
97
|
return result;
|
|
98
98
|
};
|
|
99
|
-
const transactions = {
|
|
99
|
+
const transactions = {
|
|
100
|
+
serviceName: "ecs-database-transactions-service",
|
|
101
|
+
};
|
|
100
102
|
for (const [name, transactionUntyped] of Object.entries(transactionDeclarations)) {
|
|
101
103
|
const transaction = transactionUntyped;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, { transient: true });
|
|
124
|
-
}
|
|
125
|
-
lastTransaction = execute(t => transaction(t, asyncArgs), { transient });
|
|
126
|
-
if (!transient) {
|
|
127
|
-
// this is the last value so we will resolve to it
|
|
128
|
-
resolve(lastTransaction.value);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
// Manually iterate through the generator to capture both yield and return values
|
|
132
|
-
let result = await asyncResult.next();
|
|
133
|
-
// Process yield values one by one with rollback
|
|
134
|
-
// We can't know if a yield is final until the generator completes,
|
|
135
|
-
// so we mark all yields as transient initially
|
|
136
|
-
while (!result.done) {
|
|
137
|
-
// This is a yield value - always transient initially
|
|
138
|
-
executeNext(result.value, true);
|
|
139
|
-
result = await asyncResult.next();
|
|
140
|
-
}
|
|
141
|
-
if (result.value !== undefined) {
|
|
142
|
-
executeNext(result.value, false);
|
|
104
|
+
transactions[name] = (args) => {
|
|
105
|
+
// Check if args is an AsyncArgsProvider function
|
|
106
|
+
if (typeof args === 'function') {
|
|
107
|
+
const asyncArgsProvider = args;
|
|
108
|
+
const asyncResult = asyncArgsProvider();
|
|
109
|
+
if (isAsyncGenerator(asyncResult)) {
|
|
110
|
+
let count = 0;
|
|
111
|
+
return new Promise(async (resolve, reject) => {
|
|
112
|
+
try {
|
|
113
|
+
let lastArgs = undefined;
|
|
114
|
+
let lastTransaction;
|
|
115
|
+
const executeNext = (asyncArgs, transient) => {
|
|
116
|
+
lastArgs = asyncArgs;
|
|
117
|
+
if (lastTransaction) {
|
|
118
|
+
// rollback previous transaction.
|
|
119
|
+
execute(t => {
|
|
120
|
+
if (lastTransaction) {
|
|
121
|
+
// Rollback the previous transaction to restore the state before it
|
|
122
|
+
applyOperations(t, lastTransaction.undo);
|
|
123
|
+
}
|
|
124
|
+
}, { transient: true });
|
|
143
125
|
}
|
|
144
|
-
|
|
145
|
-
|
|
126
|
+
lastTransaction = execute(t => transaction(t, asyncArgs), { transient });
|
|
127
|
+
if (!transient) {
|
|
128
|
+
// this is the last value so we will resolve to it
|
|
129
|
+
resolve(lastTransaction.value);
|
|
146
130
|
}
|
|
131
|
+
};
|
|
132
|
+
// Manually iterate through the generator to capture both yield and return values
|
|
133
|
+
let result = await asyncResult.next();
|
|
134
|
+
// Process yield values one by one with rollback
|
|
135
|
+
// We can't know if a yield is final until the generator completes,
|
|
136
|
+
// so we mark all yields as transient initially
|
|
137
|
+
while (!result.done) {
|
|
138
|
+
// This is a yield value - always transient initially
|
|
139
|
+
executeNext(result.value, true);
|
|
140
|
+
result = await asyncResult.next();
|
|
147
141
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
reject(error);
|
|
142
|
+
if (result.value !== undefined) {
|
|
143
|
+
executeNext(result.value, false);
|
|
151
144
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
else if (isPromise(asyncResult)) {
|
|
155
|
-
return new Promise(async (resolve, reject) => {
|
|
156
|
-
try {
|
|
157
|
-
const input = await asyncResult;
|
|
158
|
-
const result = execute(t => transaction(t, input));
|
|
159
|
-
resolve(result);
|
|
145
|
+
else if (lastArgs !== undefined) { // Only execute if lastArgs exists
|
|
146
|
+
executeNext(lastArgs, false);
|
|
160
147
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.error('AsyncGenerator error:', error);
|
|
151
|
+
reject(error);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else if (isPromise(asyncResult)) {
|
|
156
|
+
return new Promise(async (resolve, reject) => {
|
|
157
|
+
try {
|
|
158
|
+
const input = await asyncResult;
|
|
159
|
+
const result = execute(t => transaction(t, input));
|
|
160
|
+
resolve(result);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
reject(error);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
170
166
|
}
|
|
171
167
|
else {
|
|
172
|
-
//
|
|
173
|
-
return execute(t => transaction(t,
|
|
168
|
+
// Function returned a synchronous value
|
|
169
|
+
return execute(t => transaction(t, asyncResult));
|
|
174
170
|
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// Synchronous argument
|
|
174
|
+
return execute(t => transaction(t, args)).value;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
180
177
|
}
|
|
181
178
|
const notifyAllObserversStoreReloaded = () => {
|
|
182
179
|
const notifyResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-database.js","sourceRoot":"","sources":["../../../src/ecs/database/create-database.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAW,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAGxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"create-database.js","sourceRoot":"","sources":["../../../src/ecs/database/create-database.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAW,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAGxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,UAAU,cAAc,CAM1B,KAAqB,EACrB,uBAA2B;IAI3B,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAE3D,oCAAoC;IACpC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAmC,CAAC;IACtE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAgC,CAAC;IACnE,MAAM,eAAe,GAAG,IAAI,GAAG,EAA6D,CAAC;IAC7F,MAAM,oBAAoB,GAAG,I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GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE;QAC5B,QAAQ,EAAE,CAAC,IAAa,EAAE,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrB,+BAA+B,EAAE,CAAC;QACtC,CAAC;KACoB,CAAC;IAC1B,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,MAAM,WAAW,GAAG,CAAO,GAAM,EAAE,GAAmB,EAAE,EAAE,CAAC,CAAC,KAAQ,EAAE,EAAE;IACpE,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,GAAG,EAAE,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;SAAM,CAAC;QACJ,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,EAAE;QACR,GAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -26,7 +26,7 @@ export type TransactionFunctions = {
|
|
|
26
26
|
readonly [K: string]: (args?: any) => void | Entity;
|
|
27
27
|
};
|
|
28
28
|
export interface Database<C extends Components = never, R extends ResourceComponents = never, A extends ArchetypeComponents<StringKeyof<C>> = never, T extends TransactionFunctions = never> extends ReadonlyStore<C, R, A>, Service {
|
|
29
|
-
readonly transactions: T;
|
|
29
|
+
readonly transactions: T & Service;
|
|
30
30
|
readonly observe: {
|
|
31
31
|
readonly components: {
|
|
32
32
|
readonly [K in StringKeyof<C>]: Observe<void>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as transactions from './transactions/index.js';
|
|
2
2
|
export declare const createTodoDatabase: () => import("../../../../ecs/index.js").Database<{
|
|
3
|
-
todo: true;
|
|
4
|
-
name: string;
|
|
5
3
|
order: number;
|
|
4
|
+
name: string;
|
|
5
|
+
todo: true;
|
|
6
6
|
complete: boolean;
|
|
7
7
|
dragPosition: number | null;
|
|
8
8
|
}, {
|
|
9
9
|
displayCompleted: boolean;
|
|
10
10
|
}, {
|
|
11
|
-
Todo: ("
|
|
11
|
+
Todo: ("order" | "name" | "todo" | "complete" | "dragPosition")[];
|
|
12
12
|
}, import("../../../../ecs/index.js").ToTransactionFunctions<typeof transactions>>;
|
|
13
13
|
export type TodoDatabase = ReturnType<typeof createTodoDatabase>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const todoStoreSchemaVersion = 1;
|
|
2
2
|
export declare const createTodoStore: () => import("../../../../ecs/index.js").Store<{
|
|
3
|
-
todo: true;
|
|
4
|
-
name: string;
|
|
5
3
|
order: number;
|
|
4
|
+
name: string;
|
|
5
|
+
todo: true;
|
|
6
6
|
complete: boolean;
|
|
7
7
|
dragPosition: number | null;
|
|
8
8
|
}, {
|
|
9
9
|
displayCompleted: boolean;
|
|
10
10
|
}, {
|
|
11
|
-
Todo: ("
|
|
11
|
+
Todo: ("order" | "name" | "todo" | "complete" | "dragPosition")[];
|
|
12
12
|
}>;
|
|
13
13
|
export type TodoStore = ReturnType<typeof createTodoStore>;
|