@marcoappio/marco-config 2.0.551 → 2.0.552
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/index.d.ts +0 -23
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +0 -2
- package/dist/schemas/mutators/mutatorSchemas.d.ts +0 -9
- package/dist/schemas/mutators/mutatorSchemas.d.ts.map +1 -1
- package/dist/schemas/mutators/mutatorSchemas.js +0 -6
- package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts +0 -2
- package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/models/thread/getThreadList.js +0 -1
- package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts +0 -2
- package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/models/thread/getThreads.js +0 -1
- package/dist/sdk/endpoints/private/mutations/draft/index.d.ts +0 -1
- package/dist/sdk/endpoints/private/mutations/draft/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/mutations/draft/index.js +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/package.json +1 -2
- package/dist/schemas/drafts.d.ts +0 -16
- package/dist/schemas/drafts.d.ts.map +0 -1
- package/dist/schemas/drafts.js +0 -12
- package/dist/sdk/endpoints/private/mutations/draft/setContent.d.ts +0 -43
- package/dist/sdk/endpoints/private/mutations/draft/setContent.d.ts.map +0 -1
- package/dist/sdk/endpoints/private/mutations/draft/setContent.js +0 -19
- package/dist/utils/stringPatch/index.d.ts +0 -2
- package/dist/utils/stringPatch/index.d.ts.map +0 -1
- package/dist/utils/stringPatch/index.js +0 -1
- package/dist/utils/stringPatch/stringPatch.d.ts +0 -9
- package/dist/utils/stringPatch/stringPatch.d.ts.map +0 -1
- package/dist/utils/stringPatch/stringPatch.js +0 -36
- package/dist/utils/stringPatch/stringPatch.test.d.ts +0 -2
- package/dist/utils/stringPatch/stringPatch.test.d.ts.map +0 -1
- package/dist/utils/stringPatch/stringPatch.test.js +0 -101
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { MARCO_ENV, MarcoEnvironment, marcoPublicConfig } from './marcoPublicCon
|
|
|
3
3
|
export { type Account, type AccountAlias, type AccountLabel, type Contact, type Draft, type DraftAttachment, type DraftBody, marcoSchemas, type Thread, type ThreadMessage, type ThreadMessageAttachment, type ThreadMessageRecipient, type User, type UserPushNotificationToken, type UserView, } from './schemas';
|
|
4
4
|
export { marcoSDK } from './sdk';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export { accountUtils, labelUtils,
|
|
6
|
+
export { accountUtils, labelUtils, threadsUtils } from './utils';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { MARCO_ENV, marcoPublicConfig } from './marcoPublicConfig';
|
|
|
3
3
|
export { marcoSchemas, } from './schemas';
|
|
4
4
|
export { marcoSDK } from './sdk';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export { accountUtils, labelUtils,
|
|
6
|
+
export { accountUtils, labelUtils, threadsUtils } from './utils';
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -14,20 +14,6 @@ export declare const marcoSchemas: {
|
|
|
14
14
|
boolean: {
|
|
15
15
|
fromString: () => import("valibot").SchemaWithPipe<readonly [import("valibot").PicklistSchema<["true", "false"], undefined>, import("valibot").TransformAction<"true" | "false", boolean>, import("valibot").BooleanSchema<undefined>]>;
|
|
16
16
|
};
|
|
17
|
-
drafts: {
|
|
18
|
-
contentPatch: {
|
|
19
|
-
instruction: () => import("valibot").ObjectSchema<{
|
|
20
|
-
readonly index: import("valibot").NumberSchema<undefined>;
|
|
21
|
-
readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
|
|
22
|
-
readonly value: import("valibot").StringSchema<undefined>;
|
|
23
|
-
}, undefined>;
|
|
24
|
-
patch: () => import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
25
|
-
readonly index: import("valibot").NumberSchema<undefined>;
|
|
26
|
-
readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
|
|
27
|
-
readonly value: import("valibot").StringSchema<undefined>;
|
|
28
|
-
}, undefined>, undefined>;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
17
|
emailAccount: {
|
|
32
18
|
connectionConfigImapRaw: () => import("valibot").ObjectSchema<{
|
|
33
19
|
readonly imapHost: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -426,15 +412,6 @@ export declare const marcoSchemas: {
|
|
|
426
412
|
readonly scheduledFor: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
427
413
|
readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
428
414
|
}, undefined>], undefined>;
|
|
429
|
-
setContent: import("valibot").ObjectSchema<{
|
|
430
|
-
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>;
|
|
431
|
-
readonly patch: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
432
|
-
readonly index: import("valibot").NumberSchema<undefined>;
|
|
433
|
-
readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
|
|
434
|
-
readonly value: import("valibot").StringSchema<undefined>;
|
|
435
|
-
}, undefined>, undefined>;
|
|
436
|
-
readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
437
|
-
}, undefined>;
|
|
438
415
|
setEnvelope: import("valibot").ObjectSchema<{
|
|
439
416
|
readonly envelope: Omit<import("valibot").ObjectSchema<{
|
|
440
417
|
readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA8BA,YAAY,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,IAAI,EACJ,yBAAyB,EACzB,QAAQ,GACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BxB,CAAA"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { app } from './app';
|
|
2
2
|
import { auth } from './auth';
|
|
3
3
|
import { boolean } from './boolean';
|
|
4
|
-
import { drafts } from './drafts';
|
|
5
4
|
import { emailAccount } from './emailAccount';
|
|
6
5
|
import { labels } from './labels';
|
|
7
6
|
import { accountAliasSchema, accountLabelSchema, accountSchema, contactSchema, draftAttachmentSchema, draftBodySchema, draftSchema, threadFullSchema, threadListSchema, threadMessageAttachmentSchema, threadMessageRecipientSchema, threadMessageSchema, threadSchema, userPushNotificationTokenSchema, userSchema, userViewSchema, } from './models';
|
|
@@ -16,7 +15,6 @@ export const marcoSchemas = {
|
|
|
16
15
|
app,
|
|
17
16
|
auth,
|
|
18
17
|
boolean,
|
|
19
|
-
drafts,
|
|
20
18
|
emailAccount,
|
|
21
19
|
labels,
|
|
22
20
|
models: {
|
|
@@ -126,15 +126,6 @@ export declare const mutatorSchemas: {
|
|
|
126
126
|
readonly scheduledFor: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
127
127
|
readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
128
128
|
}, undefined>], undefined>;
|
|
129
|
-
setContent: v.ObjectSchema<{
|
|
130
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
131
|
-
readonly patch: v.ArraySchema<v.ObjectSchema<{
|
|
132
|
-
readonly index: v.NumberSchema<undefined>;
|
|
133
|
-
readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
|
|
134
|
-
readonly value: v.StringSchema<undefined>;
|
|
135
|
-
}, undefined>, undefined>;
|
|
136
|
-
readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
137
|
-
}, undefined>;
|
|
138
129
|
setEnvelope: v.ObjectSchema<{
|
|
139
130
|
readonly envelope: Omit<v.ObjectSchema<{
|
|
140
131
|
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/mutators/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/mutators/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAyF5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJ1B,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { marcoConstants } from '../../constants';
|
|
3
3
|
import { DRAFT_ATTACHMENT_UPLOAD_STATUSES, DRAFT_STATUSES, DRAFT_TYPES, USER_SETTINGS_CUSTOM_VIEW_ICONS, } from '../../types';
|
|
4
|
-
import { drafts } from '../drafts';
|
|
5
4
|
import { socketTypeSchema } from '../emailAccount';
|
|
6
5
|
import { number } from '../number';
|
|
7
6
|
import { oauth } from '../oauth';
|
|
@@ -156,11 +155,6 @@ export const mutatorSchemas = {
|
|
|
156
155
|
updatedAt: number.positiveInteger(),
|
|
157
156
|
}),
|
|
158
157
|
]),
|
|
159
|
-
setContent: v.object({
|
|
160
|
-
id: string.required(),
|
|
161
|
-
patch: drafts.contentPatch.patch(),
|
|
162
|
-
updatedAt: number.positiveInteger(),
|
|
163
|
-
}),
|
|
164
158
|
setEnvelope: v.object({
|
|
165
159
|
envelope: v.omit(draftBodySchema, ['content']),
|
|
166
160
|
id: string.required(),
|
|
@@ -4,7 +4,6 @@ export declare const getThreadList: import("../../../../..").EndpointConfig<"/v1
|
|
|
4
4
|
readonly labelIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5
5
|
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
6
6
|
readonly flagged: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false"], undefined>, v.TransformAction<"true" | "false", boolean>, v.BooleanSchema<undefined>]>, undefined>;
|
|
7
|
-
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8
7
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
9
8
|
readonly messageIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
10
9
|
readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
@@ -15,7 +14,6 @@ export declare const getThreadList: import("../../../../..").EndpointConfig<"/v1
|
|
|
15
14
|
readonly labelIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
16
15
|
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
17
16
|
readonly flagged: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false"], undefined>, v.TransformAction<"true" | "false", boolean>, v.BooleanSchema<undefined>]>, undefined>;
|
|
18
|
-
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
19
17
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
20
18
|
readonly messageIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
21
19
|
readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThreadList.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreadList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"getThreadList.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreadList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAkC5B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAaxB,CAAA"}
|
|
@@ -6,7 +6,6 @@ import { authFailedErrorSchema, userNotFoundErrorSchema, validationFailedErrorSc
|
|
|
6
6
|
const baseQuerySchema = {
|
|
7
7
|
cursor: v.optional(v.string()),
|
|
8
8
|
flagged: v.optional(marcoSchemas.boolean.fromString()),
|
|
9
|
-
id: v.optional(v.string()),
|
|
10
9
|
limit: v.optional(marcoSchemas.number.positiveIntegerFromString()),
|
|
11
10
|
messageIds: v.optional(v.array(v.string())),
|
|
12
11
|
participants: v.optional(v.array(v.string())),
|
|
@@ -3,14 +3,12 @@ export declare const getThreads: import("../../../../..").EndpointConfig<"/v1/pv
|
|
|
3
3
|
readonly ids: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4
4
|
readonly labelIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5
5
|
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
6
|
-
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
7
6
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
8
7
|
readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
9
8
|
}, undefined>, v.ObjectSchema<{
|
|
10
9
|
readonly ids: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
11
10
|
readonly labelIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
12
11
|
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
-
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
14
12
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
15
13
|
readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
16
14
|
}, undefined>], undefined>, v.UnionSchema<[v.ObjectSchema<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThreads.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"getThreads.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA8B5B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAarB,CAAA"}
|
|
@@ -5,7 +5,6 @@ import { createEndpoint } from '../../../../../sdk/endpoints/createEndpointConfi
|
|
|
5
5
|
import { authFailedErrorSchema, userNotFoundErrorSchema, validationFailedErrorSchema, } from '../../../../../sdk/validation/errors';
|
|
6
6
|
const baseQuerySchema = {
|
|
7
7
|
cursor: v.optional(v.string()),
|
|
8
|
-
id: v.optional(v.string()),
|
|
9
8
|
limit: v.optional(marcoSchemas.number.positiveIntegerFromString()),
|
|
10
9
|
participants: v.optional(v.array(v.string())),
|
|
11
10
|
};
|
|
@@ -5,7 +5,6 @@ export { deleteAttachment } from './deleteAttachment';
|
|
|
5
5
|
export { deleteDraft } from './deleteDraft';
|
|
6
6
|
export { replaceContent } from './replaceContent';
|
|
7
7
|
export { scheduleSend } from './scheduleSend';
|
|
8
|
-
export { setContent } from './setContent';
|
|
9
8
|
export { setEnvelope } from './setEnvelope';
|
|
10
9
|
export { setFrom } from './setFrom';
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/mutations/draft/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/mutations/draft/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -5,6 +5,5 @@ export { deleteAttachment } from './deleteAttachment';
|
|
|
5
5
|
export { deleteDraft } from './deleteDraft';
|
|
6
6
|
export { replaceContent } from './replaceContent';
|
|
7
7
|
export { scheduleSend } from './scheduleSend';
|
|
8
|
-
export { setContent } from './setContent';
|
|
9
8
|
export { setEnvelope } from './setEnvelope';
|
|
10
9
|
export { setFrom } from './setFrom';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marcoappio/marco-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.552",
|
|
4
4
|
"author": "team@marcoapp.io",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "git@github.com:marcoappio/marco-config.git",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"@orama/stemmers": "3.1.16",
|
|
29
29
|
"@orama/stopwords": "3.1.16",
|
|
30
30
|
"@polar-sh/sdk": "0.42.2",
|
|
31
|
-
"diff": "8.0.2",
|
|
32
31
|
"valibot": "1.1.0"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
package/dist/schemas/drafts.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
export declare const drafts: {
|
|
3
|
-
contentPatch: {
|
|
4
|
-
instruction: () => v.ObjectSchema<{
|
|
5
|
-
readonly index: v.NumberSchema<undefined>;
|
|
6
|
-
readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
|
|
7
|
-
readonly value: v.StringSchema<undefined>;
|
|
8
|
-
}, undefined>;
|
|
9
|
-
patch: () => v.ArraySchema<v.ObjectSchema<{
|
|
10
|
-
readonly index: v.NumberSchema<undefined>;
|
|
11
|
-
readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
|
|
12
|
-
readonly value: v.StringSchema<undefined>;
|
|
13
|
-
}, undefined>, undefined>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=drafts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/schemas/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAKlB,CAAA"}
|
package/dist/schemas/drafts.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
const patchInstructionSchema = v.object({
|
|
3
|
-
index: v.number(),
|
|
4
|
-
type: v.union([v.literal('INSERTION'), v.literal('DELETION')]),
|
|
5
|
-
value: v.string(),
|
|
6
|
-
});
|
|
7
|
-
export const drafts = {
|
|
8
|
-
contentPatch: {
|
|
9
|
-
instruction: () => patchInstructionSchema,
|
|
10
|
-
patch: () => v.array(patchInstructionSchema),
|
|
11
|
-
},
|
|
12
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
export declare const setContent: import("../../../../..").EndpointConfig<"/v1/pv/models/draft/:draftId/set-content", v.ObjectSchema<{
|
|
3
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
4
|
-
readonly patch: v.ArraySchema<v.ObjectSchema<{
|
|
5
|
-
readonly index: v.NumberSchema<undefined>;
|
|
6
|
-
readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
|
|
7
|
-
readonly value: v.StringSchema<undefined>;
|
|
8
|
-
}, undefined>, undefined>;
|
|
9
|
-
readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
10
|
-
}, undefined>, v.GenericSchema | undefined, v.UnionSchema<[v.ObjectSchema<{
|
|
11
|
-
readonly data: v.ObjectSchema<{
|
|
12
|
-
readonly code: v.LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
|
|
13
|
-
}, undefined>;
|
|
14
|
-
readonly status: v.LiteralSchema<401, undefined>;
|
|
15
|
-
}, undefined>, v.ObjectSchema<{
|
|
16
|
-
readonly data: v.ObjectSchema<{
|
|
17
|
-
readonly code: v.LiteralSchema<"USER_NOT_FOUND", undefined>;
|
|
18
|
-
}, undefined>;
|
|
19
|
-
readonly status: v.LiteralSchema<404, undefined>;
|
|
20
|
-
}, undefined>, v.ObjectSchema<{
|
|
21
|
-
readonly data: v.ObjectSchema<{
|
|
22
|
-
readonly code: v.LiteralSchema<"DRAFT_NOT_FOUND", undefined>;
|
|
23
|
-
}, undefined>;
|
|
24
|
-
readonly status: v.LiteralSchema<404, undefined>;
|
|
25
|
-
}, undefined>, v.ObjectSchema<{
|
|
26
|
-
readonly data: v.ObjectSchema<{
|
|
27
|
-
readonly code: v.LiteralSchema<"MUTATION_REJECTED", undefined>;
|
|
28
|
-
}, undefined>;
|
|
29
|
-
readonly status: v.LiteralSchema<409, undefined>;
|
|
30
|
-
}, undefined>, v.ObjectSchema<{
|
|
31
|
-
readonly data: v.ObjectSchema<{
|
|
32
|
-
readonly code: v.LiteralSchema<"VALIDATION_FAILED", undefined>;
|
|
33
|
-
readonly issues: v.ObjectSchema<{
|
|
34
|
-
readonly nested: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
|
|
35
|
-
readonly other: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
36
|
-
readonly root: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
37
|
-
}, undefined>;
|
|
38
|
-
}, undefined>;
|
|
39
|
-
readonly status: v.LiteralSchema<400, undefined>;
|
|
40
|
-
}, undefined>, v.ObjectSchema<{
|
|
41
|
-
readonly status: v.LiteralSchema<200, undefined>;
|
|
42
|
-
}, undefined>], undefined>>;
|
|
43
|
-
//# sourceMappingURL=setContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setContent.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/mutations/draft/setContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAY5B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAcrB,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
import { mutatorSchemas } from '../../../../../schemas';
|
|
3
|
-
import { createEndpoint } from '../../../../../sdk/endpoints/createEndpointConfig';
|
|
4
|
-
import { authFailedErrorSchema, draftNotFoundErrorSchema, mutationRejectedErrorSchema, userNotFoundErrorSchema, validationFailedErrorSchema, } from '../../../../../sdk/validation/errors';
|
|
5
|
-
export const setContent = createEndpoint({
|
|
6
|
-
body: mutatorSchemas.draft.setContent,
|
|
7
|
-
method: 'PATCH',
|
|
8
|
-
path: '/v1/pv/models/draft/:draftId/set-content',
|
|
9
|
-
response: v.union([
|
|
10
|
-
authFailedErrorSchema,
|
|
11
|
-
userNotFoundErrorSchema,
|
|
12
|
-
draftNotFoundErrorSchema,
|
|
13
|
-
mutationRejectedErrorSchema,
|
|
14
|
-
validationFailedErrorSchema,
|
|
15
|
-
v.object({
|
|
16
|
-
status: v.literal(200),
|
|
17
|
-
}),
|
|
18
|
-
]),
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/stringPatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { stringPatch } from './stringPatch';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type * as v from 'valibot';
|
|
2
|
-
import type { marcoSchemas } from '../../schemas';
|
|
3
|
-
type Patch = v.InferOutput<ReturnType<typeof marcoSchemas.drafts.contentPatch.patch>>;
|
|
4
|
-
export declare const stringPatch: {
|
|
5
|
-
apply: (text: string, patch: Patch) => string;
|
|
6
|
-
create: (startText: string, endText: string) => Patch;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=stringPatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringPatch.d.ts","sourceRoot":"","sources":["../../../src/utils/stringPatch/stringPatch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,KAAK,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AAErF,eAAO,MAAM,WAAW;kBACR,MAAM,SAAS,KAAK,KAAG,MAAM;wBAgBvB,MAAM,WAAW,MAAM,KAAG,KAAK;CAmBpD,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { diffChars } from 'diff';
|
|
2
|
-
export const stringPatch = {
|
|
3
|
-
apply: (text, patch) => {
|
|
4
|
-
for (const instruction of patch) {
|
|
5
|
-
switch (instruction.type) {
|
|
6
|
-
case 'INSERTION': {
|
|
7
|
-
text = text.slice(0, instruction.index) + instruction.value + text.slice(instruction.index);
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
10
|
-
case 'DELETION': {
|
|
11
|
-
text = text.slice(0, instruction.index) + text.slice(instruction.index + instruction.value.length);
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return text;
|
|
17
|
-
},
|
|
18
|
-
create: (startText, endText) => {
|
|
19
|
-
const charChanges = diffChars(startText, endText);
|
|
20
|
-
const patch = [];
|
|
21
|
-
let index = 0;
|
|
22
|
-
for (const change of charChanges) {
|
|
23
|
-
if (change.added) {
|
|
24
|
-
patch.push({ index, type: 'INSERTION', value: change.value });
|
|
25
|
-
index += change.value.length;
|
|
26
|
-
}
|
|
27
|
-
else if (change.removed) {
|
|
28
|
-
patch.push({ index, type: 'DELETION', value: change.value });
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
index += change.value.length;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return patch;
|
|
35
|
-
},
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringPatch.test.d.ts","sourceRoot":"","sources":["../../../src/utils/stringPatch/stringPatch.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
import { stringPatch } from './stringPatch';
|
|
3
|
-
describe('stringPatch', () => {
|
|
4
|
-
const testCases = [
|
|
5
|
-
['hello world', 'hello beautiful world'],
|
|
6
|
-
['the quick brown fox', 'the slow brown fox'],
|
|
7
|
-
['', 'new content'],
|
|
8
|
-
['delete me', ''],
|
|
9
|
-
['no changes', 'no changes'],
|
|
10
|
-
['one two three', 'one three'],
|
|
11
|
-
['start middle end', 'start new middle end'],
|
|
12
|
-
['repeated repeated words', 'repeated words'],
|
|
13
|
-
['missing punctuation', 'missing, punctuation!'],
|
|
14
|
-
['old formatting', 'NEW FORMATTING'],
|
|
15
|
-
['extra spaces', 'extra spaces'],
|
|
16
|
-
['camelCase', 'snake_case'],
|
|
17
|
-
['this is a test', 'this is only a test'],
|
|
18
|
-
['remove last word test', 'remove last word'],
|
|
19
|
-
['beginning test', 'new beginning test'],
|
|
20
|
-
['[brackets]', '{curly brackets}'],
|
|
21
|
-
['line\nbreak', 'line break'],
|
|
22
|
-
['tab\tseparated', 'space separated'],
|
|
23
|
-
['numbers 123', 'numbers 456'],
|
|
24
|
-
['special chars !@#', 'different chars $%^'],
|
|
25
|
-
['uppercase TEXT', 'lowercase text'],
|
|
26
|
-
['trim this ', 'trim this'],
|
|
27
|
-
[' leading space', 'leading space'],
|
|
28
|
-
['mixed CASE text', 'all lower case text'],
|
|
29
|
-
['join these words', 'jointheseswords'],
|
|
30
|
-
['split,words,here', 'split words here'],
|
|
31
|
-
['version 1.0.0', 'version 2.0.0'],
|
|
32
|
-
['prefix-', 'prefix-added'],
|
|
33
|
-
['-suffix', 'added-suffix'],
|
|
34
|
-
['multi\nline\ntext', 'single line text'],
|
|
35
|
-
['short', 'much longer replacement'],
|
|
36
|
-
['very long original text', 'short'],
|
|
37
|
-
['kebab-case', 'camelCase'],
|
|
38
|
-
['PascalCase', 'camelCase'],
|
|
39
|
-
['duplicate duplicate', 'duplicate'],
|
|
40
|
-
[' multiple spaces ', 'single space'],
|
|
41
|
-
['<html>tags</html>', 'plain text'],
|
|
42
|
-
["quoted 'text'", 'quoted "text"'],
|
|
43
|
-
['email@test.com', 'newemail@test.com'],
|
|
44
|
-
['http://old.url', 'http://new.url'],
|
|
45
|
-
['date: 2023-01-01', 'date: 2024-01-01'],
|
|
46
|
-
['rgb(255,0,0)', 'rgb(0,255,0)'],
|
|
47
|
-
['function(){\n}', 'function() {\n}'],
|
|
48
|
-
['snake_case_text', 'camelCaseText'],
|
|
49
|
-
['trailing comma,', 'no trailing comma'],
|
|
50
|
-
['...ellipsis', 'no ellipsis'],
|
|
51
|
-
['**markdown**', '_different markdown_'],
|
|
52
|
-
['(parentheses)', '[brackets]'],
|
|
53
|
-
['TRUE', 'false'],
|
|
54
|
-
['1234567890', '0987654321'],
|
|
55
|
-
['café', 'cafe'],
|
|
56
|
-
['🌟 star', '⭐ star'],
|
|
57
|
-
['é è ê ë', 'e e e e'],
|
|
58
|
-
['über', 'uber'],
|
|
59
|
-
['中文', 'chinese'],
|
|
60
|
-
['→↓←↑', '>>>>'],
|
|
61
|
-
['\u200B\u200Bzero width spaces\u200B', 'no zero width spaces'],
|
|
62
|
-
['line1\r\nline2\r\nline3', 'line1\nline2\nline3'],
|
|
63
|
-
['tab\u0009unicode', 'tab normal'],
|
|
64
|
-
['no\u00A0break\u00A0space', 'normal spaces'],
|
|
65
|
-
['mixed \t \n spaces', 'single space'],
|
|
66
|
-
['hidden\u0000null', 'visible text'],
|
|
67
|
-
['bell\u0007char', 'normal char'],
|
|
68
|
-
['vertical\u000Btab', 'normal tab'],
|
|
69
|
-
['Hello שָׁלוֹם', 'Hello peace'],
|
|
70
|
-
['مرحبا world', 'hello world'],
|
|
71
|
-
['a\u202Eb\u202Cc', 'abc'],
|
|
72
|
-
['', ''],
|
|
73
|
-
['a', ''],
|
|
74
|
-
['', 'a'],
|
|
75
|
-
['a', 'b'],
|
|
76
|
-
['aa', 'a'],
|
|
77
|
-
['a', 'aa'],
|
|
78
|
-
['abababab', 'ab'],
|
|
79
|
-
['aaaaaa', 'a'],
|
|
80
|
-
['a b a b a b', 'a b'],
|
|
81
|
-
['{"key":"value"}', '{"newKey":"newValue"}'],
|
|
82
|
-
['[1,2,3]', '[4,5,6]'],
|
|
83
|
-
['https://user:pass@host.com:8080/path?q=1#hash', 'https://newhost.com/path'],
|
|
84
|
-
['?param1=1¶m2=2', '?param1=2¶m2=1'],
|
|
85
|
-
['C:\\Windows\\Path', '/unix/path'],
|
|
86
|
-
['./relative/path', '../other/path'],
|
|
87
|
-
['2024-02-17T12:00:00Z', '2024-02-17T13:00:00Z'],
|
|
88
|
-
['<![CDATA[test]]>', 'normal text'],
|
|
89
|
-
['BASE64/test==', 'plain text'],
|
|
90
|
-
['<script>alert(1)</script>', 'sanitized'],
|
|
91
|
-
['../../../../etc/passwd', 'safe/path'],
|
|
92
|
-
["Robert'); DROP TABLE Students;--", 'Robert'],
|
|
93
|
-
];
|
|
94
|
-
for (const [start, end] of testCases) {
|
|
95
|
-
it(`should create a patch for ${start} to ${end}`, () => {
|
|
96
|
-
const patch = stringPatch.create(start, end);
|
|
97
|
-
const patched = stringPatch.apply(start, patch);
|
|
98
|
-
expect(patched).toBe(end);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
});
|