@volontariapp/domain-user 2.6.1 → 2.6.2
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/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const USERS_TRIGGER:
|
|
1
|
+
export declare const USERS_TRIGGER = "\nDROP TRIGGER IF EXISTS users_created_event_queue_trigger ON users;\n\nCREATE OR REPLACE FUNCTION create_user_created_event_queue_record()\nRETURNS TRIGGER AS $$\nBEGIN\n IF (TG_OP = 'INSERT') THEN\n INSERT INTO event_queue (\n type,\n emitter,\n \"emitterId\",\n payload,\n target_services,\n version,\n status,\n attempts,\n updated_at,\n created_at\n ) VALUES (\n 'user.created',\n 'ms-user',\n NEW.id,\n jsonb_build_object('id', NEW.id, 'role', NEW.role),\n ARRAY['social:user'],\n 1,\n 'PENDING',\n 0,\n now(),\n now()\n );\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;\n\nCREATE TRIGGER users_created_event_queue_trigger\nAFTER INSERT ON users\nFOR EACH ROW EXECUTE FUNCTION create_user_created_event_queue_record();\n";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/triggers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/triggers/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,09BAsCzB,CAAC"}
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export const USERS_TRIGGER = `
|
|
2
|
+
DROP TRIGGER IF EXISTS users_created_event_queue_trigger ON users;
|
|
3
|
+
|
|
4
|
+
CREATE OR REPLACE FUNCTION create_user_created_event_queue_record()
|
|
5
|
+
RETURNS TRIGGER AS $$
|
|
6
|
+
BEGIN
|
|
7
|
+
IF (TG_OP = 'INSERT') THEN
|
|
8
|
+
INSERT INTO event_queue (
|
|
9
|
+
type,
|
|
10
|
+
emitter,
|
|
11
|
+
"emitterId",
|
|
12
|
+
payload,
|
|
13
|
+
target_services,
|
|
14
|
+
version,
|
|
15
|
+
status,
|
|
16
|
+
attempts,
|
|
17
|
+
updated_at,
|
|
18
|
+
created_at
|
|
19
|
+
) VALUES (
|
|
20
|
+
'user.created',
|
|
21
|
+
'ms-user',
|
|
22
|
+
NEW.id,
|
|
23
|
+
jsonb_build_object('id', NEW.id, 'role', NEW.role),
|
|
24
|
+
ARRAY['social:user'],
|
|
25
|
+
1,
|
|
26
|
+
'PENDING',
|
|
27
|
+
0,
|
|
28
|
+
now(),
|
|
29
|
+
now()
|
|
30
|
+
);
|
|
31
|
+
END IF;
|
|
32
|
+
RETURN NEW;
|
|
33
|
+
END;
|
|
34
|
+
$$ LANGUAGE plpgsql;
|
|
35
|
+
|
|
36
|
+
CREATE TRIGGER users_created_event_queue_trigger
|
|
37
|
+
AFTER INSERT ON users
|
|
38
|
+
FOR EACH ROW EXECUTE FUNCTION create_user_created_event_queue_record();
|
|
39
|
+
`;
|
|
11
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/database/triggers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/database/triggers/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC5B,CAAC"}
|