@marcoappio/marco-config 2.0.439 → 2.0.441
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/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +1 -0
- package/dist/constants/messages.d.ts.map +1 -1
- package/dist/constants/messages.js +2 -1
- package/dist/zero/index.d.ts +1 -1
- package/dist/zero/mutatorSchemas/index.d.ts +1 -1
- package/dist/zero/mutatorSchemas/user.d.ts +1 -1
- package/dist/zero/mutatorSchemas/user.js +1 -1
- package/dist/zero/mutators/userMutators/userMutators.d.ts.map +1 -1
- package/dist/zero/mutators/userMutators/userMutators.js +3 -9
- package/dist/zero/mutators/userMutators/userMutators.test.js +1 -40
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/constants/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/constants/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const messages = {
|
|
2
2
|
COLLAPSIBLE_DATA_ATTRIBUTE: 'marco-collapsible',
|
|
3
|
-
|
|
3
|
+
GET_ATTACHMENT_ENDPOINT: '/v1/pv/attachment/:attachmentId',
|
|
4
|
+
GET_HTML_ENDPOINT: '/v1/pv/message/:messageId/html',
|
|
4
5
|
PREVIEW_TEXT_MAX_LENGTH: 120,
|
|
5
6
|
};
|
package/dist/zero/index.d.ts
CHANGED
|
@@ -320,7 +320,7 @@ export declare const marcoZero: {
|
|
|
320
320
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
321
321
|
readonly pushNotificationToken: import("valibot").ObjectSchema<{
|
|
322
322
|
readonly createdAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
323
|
-
readonly
|
|
323
|
+
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
324
324
|
readonly token: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
325
325
|
}, undefined>;
|
|
326
326
|
}, undefined>;
|
|
@@ -318,7 +318,7 @@ export declare const zeroMutatorSchemas: {
|
|
|
318
318
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
319
319
|
readonly pushNotificationToken: import("valibot").ObjectSchema<{
|
|
320
320
|
readonly createdAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
321
|
-
readonly
|
|
321
|
+
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
322
322
|
readonly token: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
323
323
|
}, undefined>;
|
|
324
324
|
}, undefined>;
|
|
@@ -17,7 +17,7 @@ export declare const userMutatorSchemas: {
|
|
|
17
17
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
18
18
|
readonly pushNotificationToken: v.ObjectSchema<{
|
|
19
19
|
readonly createdAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
20
|
-
readonly
|
|
20
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
21
21
|
readonly token: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
22
22
|
}, undefined>;
|
|
23
23
|
}, undefined>;
|
|
@@ -2,7 +2,7 @@ import * as v from 'valibot';
|
|
|
2
2
|
import { marcoSchemas } from '../../schemas';
|
|
3
3
|
const userPushNotificationTokenSchema = v.object({
|
|
4
4
|
createdAt: marcoSchemas.number.positiveInteger(),
|
|
5
|
-
|
|
5
|
+
id: marcoSchemas.string.required(),
|
|
6
6
|
token: marcoSchemas.string.required(),
|
|
7
7
|
});
|
|
8
8
|
export const userMutatorSchemas = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/userMutators/userMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACxC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KACxD,OAAO,CAAC,IAAI,CAAC;CACnB,CAAA;AAED,eAAO,MAAM,kBAAkB,cAClB,QAAQ,GAAG,SAAS,cACnB,oBAAoB,KAC/B,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"userMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/userMutators/userMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACxC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KACxD,OAAO,CAAC,IAAI,CAAC;CACnB,CAAA;AAED,eAAO,MAAM,kBAAkB,cAClB,QAAQ,GAAG,SAAS,cACnB,oBAAoB,KAC/B,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAkCtC,CAAA"}
|
|
@@ -18,20 +18,14 @@ export const createUserMutators = (_authData, callbacks) => ({
|
|
|
18
18
|
.where('token', args.pushNotificationToken.token)
|
|
19
19
|
.one()
|
|
20
20
|
.run();
|
|
21
|
-
if (existing) {
|
|
22
|
-
await tx.mutate.userPushNotificationToken.update({
|
|
23
|
-
createdAt: args.pushNotificationToken.createdAt,
|
|
24
|
-
id: existing.id,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
21
|
+
if (!existing) {
|
|
28
22
|
await tx.mutate.userPushNotificationToken.insert({
|
|
29
23
|
createdAt: args.pushNotificationToken.createdAt,
|
|
30
|
-
id:
|
|
24
|
+
id: args.pushNotificationToken.id,
|
|
31
25
|
token: args.pushNotificationToken.token,
|
|
32
26
|
userId: args.id,
|
|
33
27
|
});
|
|
28
|
+
await callbacks?.setSettingsPushNotificationToken?.(args);
|
|
34
29
|
}
|
|
35
|
-
await callbacks?.setSettingsPushNotificationToken?.(args);
|
|
36
30
|
},
|
|
37
31
|
});
|
|
@@ -69,7 +69,7 @@ describe('userMutators', () => {
|
|
|
69
69
|
id: 'test-user-id',
|
|
70
70
|
pushNotificationToken: {
|
|
71
71
|
createdAt: 1_000,
|
|
72
|
-
|
|
72
|
+
id: 'test-user-id-test-device-id',
|
|
73
73
|
token: 'test-token',
|
|
74
74
|
},
|
|
75
75
|
});
|
|
@@ -80,44 +80,5 @@ describe('userMutators', () => {
|
|
|
80
80
|
userId: 'test-user-id',
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
-
it('updates push notification token when token exists', async () => {
|
|
84
|
-
const existingToken = {
|
|
85
|
-
createdAt: 500,
|
|
86
|
-
id: 'test-user-id-test-device-id',
|
|
87
|
-
token: 'test-token',
|
|
88
|
-
userId: 'test-user-id',
|
|
89
|
-
};
|
|
90
|
-
const run = mock(async () => existingToken);
|
|
91
|
-
const one = mock(() => ({ run }));
|
|
92
|
-
const whereToken = mock(() => ({ one }));
|
|
93
|
-
const whereUserId = mock(() => ({ where: whereToken }));
|
|
94
|
-
const tokenUpdate = mock(async () => { });
|
|
95
|
-
const transaction = {
|
|
96
|
-
mutate: {
|
|
97
|
-
userPushNotificationToken: {
|
|
98
|
-
insert: mock(async () => { }),
|
|
99
|
-
update: tokenUpdate,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
query: {
|
|
103
|
-
userPushNotificationToken: {
|
|
104
|
-
where: whereUserId,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
const mutators = createMutators();
|
|
109
|
-
await mutators.user.setSettingsPushNotificationToken(transaction, {
|
|
110
|
-
id: 'test-user-id',
|
|
111
|
-
pushNotificationToken: {
|
|
112
|
-
createdAt: 2_000,
|
|
113
|
-
deviceId: 'test-device-id',
|
|
114
|
-
token: 'test-token',
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
expect(tokenUpdate).toHaveBeenCalledWith({
|
|
118
|
-
createdAt: 2_000,
|
|
119
|
-
id: 'test-user-id-test-device-id',
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
83
|
});
|
|
123
84
|
});
|