@marcoappio/marco-config 2.0.579 → 2.0.580

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.
@@ -189,10 +189,11 @@ declare const rowSchemas: {
189
189
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
190
190
  }, undefined>;
191
191
  readonly profiles: v.StrictObjectSchema<{
192
+ readonly avatarFileId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>, undefined>;
192
193
  readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
193
- readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
194
- readonly onboardingState: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
195
- readonly timezone: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
194
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
195
+ readonly onboardingState: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
196
+ readonly timezone: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
196
197
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
197
198
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
198
199
  readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
@@ -495,10 +496,11 @@ export declare const appwrite: {
495
496
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
496
497
  }, undefined>;
497
498
  readonly profiles: v.StrictObjectSchema<{
499
+ readonly avatarFileId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>, undefined>;
498
500
  readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
499
- readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
500
- readonly onboardingState: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
501
- readonly timezone: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
501
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
502
+ readonly onboardingState: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
503
+ readonly timezone: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
502
504
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
503
505
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
504
506
  readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
@@ -1 +1 @@
1
- {"version":3,"file":"appwrite.d.ts","sourceRoot":"","sources":["../../src/appwrite/appwrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAgE5B,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoLN,CAAA;AAEV,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYX,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,UAAU,CA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,10 +181,11 @@ const rowSchemas = {
181
181
  }),
182
182
  profiles: v.strictObject({
183
183
  ...wireMetadata(appwriteIds.tables.profiles),
184
+ avatarFileId: v.nullable(appwriteRowIdSchema),
184
185
  email: emailSchema,
185
- name: v.optional(identifierSchema),
186
- onboardingState: v.optional(identifierSchema),
187
- timezone: v.optional(identifierSchema),
186
+ name: v.nullable(identifierSchema),
187
+ onboardingState: v.nullable(identifierSchema),
188
+ timezone: v.nullable(identifierSchema),
188
189
  }),
189
190
  pushNotificationTokens: v.strictObject({
190
191
  ...wireMetadata(appwriteIds.tables.pushNotificationTokens),
@@ -140,7 +140,11 @@ const validRows = {
140
140
  profiles: {
141
141
  ...metadata,
142
142
  $tableId: 'profiles',
143
+ avatarFileId: null,
143
144
  email: 'marco@example.com',
145
+ name: null,
146
+ onboardingState: null,
147
+ timezone: null,
144
148
  },
145
149
  pushNotificationTokens: {
146
150
  ...metadata,
@@ -1,11 +1,14 @@
1
1
  import * as v from 'valibot';
2
+ export declare const appwriteAvatar: {
3
+ createFileId: (userId: string, sha256: string) => string;
4
+ };
2
5
  export declare const appwriteCommands: {
3
6
  readonly errorCodes: readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "COMMAND_CONFLICT", "COMMAND_NOT_FOUND", "INVALID_COMMAND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"];
4
7
  readonly errorSchema: v.StrictObjectSchema<{
5
8
  readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "COMMAND_CONFLICT", "COMMAND_NOT_FOUND", "INVALID_COMMAND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
6
9
  readonly retryable: v.BooleanSchema<undefined>;
7
10
  }, undefined>;
8
- readonly kinds: readonly ["profile.settings.set", "account.settings.set", "account.delete", "alias.create", "alias.delete", "alias.name.set", "alias.primary.set", "alias.signature.set", "label.create", "label.delete", "label.rename", "thread.label.add", "thread.label.remove", "thread.archive.set", "thread.flagged.set", "thread.seen.set", "thread.snooze.set", "thread.spam.set", "thread.trash.set", "thread.delete", "draft.create", "draft.content.set", "draft.envelope.set", "draft.from.set", "draft.delete", "draft.attachment.link", "draft.attachment.delete", "draft.send", "draft.send.cancel", "draft.send.schedule"];
11
+ readonly kinds: readonly ["profile.settings.set", "profile.avatar.set", "account.settings.set", "account.delete", "alias.create", "alias.delete", "alias.name.set", "alias.primary.set", "alias.signature.set", "label.create", "label.delete", "label.rename", "thread.label.add", "thread.label.remove", "thread.archive.set", "thread.flagged.set", "thread.seen.set", "thread.snooze.set", "thread.spam.set", "thread.trash.set", "thread.delete", "draft.create", "draft.content.set", "draft.envelope.set", "draft.from.set", "draft.delete", "draft.attachment.link", "draft.attachment.delete", "draft.send", "draft.send.cancel", "draft.send.schedule"];
9
12
  readonly requestSchema: v.VariantSchema<"kind", readonly [v.StrictObjectSchema<{
10
13
  readonly accountId: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>, undefined>;
11
14
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
@@ -16,6 +19,15 @@ export declare const appwriteCommands: {
16
19
  }, undefined>;
17
20
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
18
21
  readonly version: v.LiteralSchema<1, undefined>;
22
+ }, undefined>, v.StrictObjectSchema<{
23
+ readonly accountId: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>, undefined>;
24
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
25
+ readonly kind: v.LiteralSchema<"profile.avatar.set", undefined>;
26
+ readonly payload: v.StrictObjectSchema<{
27
+ readonly sha256: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
28
+ }, undefined>;
29
+ readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
30
+ readonly version: v.LiteralSchema<1, undefined>;
19
31
  }, undefined>, v.StrictObjectSchema<{
20
32
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>;
21
33
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/appwrite/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAiQ5B,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnB,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAA;AACrF,M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sB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,aAAa,CAAC,CAAA;AACzF,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAA;AAChE,MAAM,MAAM,sBAAsB,CAAC,KAAK,SAAS,mBAAmB,IAAI,OAAO,CAC7E,sBAAsB,EACtB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAChB,CAAC,SAAS,CAAC,CAAA;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAA;AAC3F,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAA"}
@@ -6,6 +6,11 @@ const commandIdSchema = v.pipe(v.string(), v.uuid(), v.brand('CommandId'));
6
6
  const nonNegativeIntegerSchema = v.pipe(v.number(), v.integer(), v.minValue(0));
7
7
  const timestampSchema = v.pipe(v.string(), v.isoTimestamp());
8
8
  const threadIdsSchema = v.pipe(v.array(id.threadId.required()), v.minLength(1));
9
+ const avatarSha256Schema = v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/));
10
+ const appwriteUserIdSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(20), v.regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/));
11
+ export const appwriteAvatar = {
12
+ createFileId: (userId, sha256) => `avatar_${v.parse(appwriteUserIdSchema, userId)}${v.parse(avatarSha256Schema, sha256).slice(0, 9)}`,
13
+ };
9
14
  const commandKinds = {
10
15
  accountDelete: 'account.delete',
11
16
  accountSettingsSet: 'account.settings.set',
@@ -27,6 +32,7 @@ const commandKinds = {
27
32
  labelCreate: 'label.create',
28
33
  labelDelete: 'label.delete',
29
34
  labelRename: 'label.rename',
35
+ profileAvatarSet: 'profile.avatar.set',
30
36
  profileSettingsSet: 'profile.settings.set',
31
37
  threadArchiveSet: 'thread.archive.set',
32
38
  threadDelete: 'thread.delete',
@@ -40,6 +46,7 @@ const commandKinds = {
40
46
  };
41
47
  const appwriteCommandKinds = [
42
48
  commandKinds.profileSettingsSet,
49
+ commandKinds.profileAvatarSet,
43
50
  commandKinds.accountSettingsSet,
44
51
  commandKinds.accountDelete,
45
52
  commandKinds.aliasCreate,
@@ -95,6 +102,7 @@ const profileSettingsSetPayloadSchema = v.strictObject({
95
102
  name: v.optional(v.nullable(string.required())),
96
103
  timezone: v.optional(v.nullable(string.required())),
97
104
  });
105
+ const profileAvatarSetPayloadSchema = v.strictObject({ sha256: avatarSha256Schema });
98
106
  const accountSettingsSetPayloadSchema = v.strictObject({
99
107
  colour: v.optional(string.required(64)),
100
108
  displayName: v.optional(v.nullable(string.required())),
@@ -166,6 +174,7 @@ const draftSendCancelPayloadSchema = v.strictObject({ draftId: id.draftId.requir
166
174
  const draftSendSchedulePayloadSchema = v.strictObject({ draftId: id.draftId.required(), scheduledAt: timestampSchema });
167
175
  const commandRequestSchemas = [
168
176
  createCommandRequestSchema(commandKinds.profileSettingsSet, profileSettingsSetPayloadSchema, v.nullable(accountIdSchema)),
177
+ createCommandRequestSchema(commandKinds.profileAvatarSet, profileAvatarSetPayloadSchema, v.nullable(accountIdSchema)),
169
178
  createAccountCommandRequestSchema(commandKinds.accountSettingsSet, accountSettingsSetPayloadSchema),
170
179
  createAccountCommandRequestSchema(commandKinds.accountDelete, accountDeletePayloadSchema),
171
180
  createAccountCommandRequestSchema(commandKinds.aliasCreate, aliasCreatePayloadSchema),
@@ -1,11 +1,13 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
2
  import * as v from 'valibot';
3
- import { appwriteCommands } from './commands';
3
+ import { appwriteAvatar, appwriteCommands } from './commands';
4
4
  const commandMetadata = {
5
5
  id: '0197f3d4-1b22-7abc-8def-123456789abc',
6
6
  submittedAt: '2026-07-15T00:00:00.000Z',
7
7
  version: 1,
8
8
  };
9
+ const avatarSha256 = 'a'.repeat(64);
10
+ const avatarUserId = 'avatarowner123456789';
9
11
  const commandFixtures = [
10
12
  {
11
13
  command: {
@@ -232,12 +234,21 @@ const commandFixtures = [
232
234
  payload: { draftId: 'draft_1', scheduledAt: '2026-07-16T00:00:00.000Z' },
233
235
  },
234
236
  },
237
+ {
238
+ command: {
239
+ ...commandMetadata,
240
+ accountId: null,
241
+ kind: 'profile.avatar.set',
242
+ payload: { sha256: avatarSha256 },
243
+ },
244
+ },
235
245
  ];
236
246
  describe('appwriteCommands', () => {
237
247
  it('publishes the complete version-one command and status manifest', () => {
238
248
  expect(appwriteCommands.version).toBe(1);
239
249
  expect(appwriteCommands.kinds).toEqual([
240
250
  'profile.settings.set',
251
+ 'profile.avatar.set',
241
252
  'account.settings.set',
242
253
  'account.delete',
243
254
  'alias.create',
@@ -280,6 +291,13 @@ describe('appwriteCommands', () => {
280
291
  'INTERNAL_ERROR',
281
292
  ]);
282
293
  });
294
+ it('derives a user-scoped content-addressed avatar file ID within Appwrite limits', () => {
295
+ expect(appwriteAvatar.createFileId(avatarUserId, avatarSha256)).toBe(`avatar_${avatarUserId}${avatarSha256.slice(0, 9)}`);
296
+ });
297
+ it('rejects an invalid avatar input before deriving a file ID', () => {
298
+ expect(() => appwriteAvatar.createFileId(avatarUserId, 'not-a-sha256')).toThrow();
299
+ expect(() => appwriteAvatar.createFileId('invalid!user', avatarSha256)).toThrow();
300
+ });
283
301
  for (const { command } of commandFixtures) {
284
302
  it(`accepts ${command.kind}`, () => {
285
303
  expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(true);
@@ -320,6 +338,15 @@ describe('appwriteCommands', () => {
320
338
  command: { ...commandFixtures[0].command, version: 2 },
321
339
  description: 'an unknown command version',
322
340
  },
341
+ {
342
+ command: {
343
+ ...commandMetadata,
344
+ accountId: null,
345
+ kind: 'profile.avatar.set',
346
+ payload: { sha256: 'not-a-sha256' },
347
+ },
348
+ description: 'an avatar command without a SHA-256 digest',
349
+ },
323
350
  ];
324
351
  for (const { command, description } of invalidCommands) {
325
352
  it(`rejects ${description}`, () => {
@@ -110,6 +110,15 @@ export declare const appwriteFunctions: {
110
110
  }, undefined>;
111
111
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
112
112
  readonly version: v.LiteralSchema<1, undefined>;
113
+ }, undefined>, v.StrictObjectSchema<{
114
+ readonly accountId: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>, undefined>;
115
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
116
+ readonly kind: v.LiteralSchema<"profile.avatar.set", undefined>;
117
+ readonly payload: v.StrictObjectSchema<{
118
+ readonly sha256: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
119
+ }, undefined>;
120
+ readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
121
+ readonly version: v.LiteralSchema<1, undefined>;
113
122
  }, undefined>, v.StrictObjectSchema<{
114
123
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>;
115
124
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/appwrite/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B,KAAK,uBAAuB,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,CAAA;AAqJvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ClC,SAAS,SAAS,oBAAoB,EACtC,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IACjD,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS;IAAE,cAAc,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAC1G,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GACtB,KAAK,CAAA"}
@@ -1,4 +1,4 @@
1
1
  export { type AppwriteRow, type AppwriteRowTable, appwrite } from './appwrite';
2
- export { type AppwriteCommandError, type AppwriteCommandKind, type AppwriteCommandPayload, type AppwriteCommandRequest, type AppwriteCommandResponse, type AppwriteCommandState, appwriteCommands, } from './commands';
2
+ export { type AppwriteCommandError, type AppwriteCommandKind, type AppwriteCommandPayload, type AppwriteCommandRequest, type AppwriteCommandResponse, type AppwriteCommandState, appwriteAvatar, appwriteCommands, } from './commands';
3
3
  export { type AppwriteFunctionContext, type AppwriteFunctionError, type AppwriteFunctionName, type AppwriteFunctionRequest, type AppwriteFunctionResponse, type AppwriteFunctionRoute, type AppwriteFunctionRouteName, appwriteFunctions, } from './functions';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appwrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,gBAAgB,GACjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,iBAAiB,GAClB,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appwrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,iBAAiB,GAClB,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
1
  export { appwrite } from './appwrite';
2
- export { appwriteCommands, } from './commands';
2
+ export { appwriteAvatar, appwriteCommands, } from './commands';
3
3
  export { appwriteFunctions, } from './functions';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type AppwriteCommandError, type AppwriteCommandKind, type AppwriteCommandPayload, type AppwriteCommandRequest, type AppwriteCommandResponse, type AppwriteCommandState, type AppwriteFunctionContext, type AppwriteFunctionError, type AppwriteFunctionName, type AppwriteFunctionRequest, type AppwriteFunctionResponse, type AppwriteFunctionRoute, type AppwriteFunctionRouteName, type AppwriteRow, type AppwriteRowTable, appwrite, appwriteCommands, appwriteFunctions, } from './appwrite';
1
+ export { type AppwriteCommandError, type AppwriteCommandKind, type AppwriteCommandPayload, type AppwriteCommandRequest, type AppwriteCommandResponse, type AppwriteCommandState, type AppwriteFunctionContext, type AppwriteFunctionError, type AppwriteFunctionName, type AppwriteFunctionRequest, type AppwriteFunctionResponse, type AppwriteFunctionRoute, type AppwriteFunctionRouteName, type AppwriteRow, type AppwriteRowTable, appwrite, appwriteAvatar, appwriteCommands, appwriteFunctions, } from './appwrite';
2
2
  export { marcoConstants } from './constants';
3
3
  export { MARCO_ENV, MarcoEnvironment, marcoPublicConfig } from './marcoPublicConfig';
4
4
  export { type Account, type AccountAlias, type AccountId, type AccountLabel, type AliasId, type AttachmentId, type Contact, type ContactId, type Draft, type DraftAttachment, type DraftBody, type DraftId, type JobId, type LabelId, type MessageId, marcoSchemas, type PushNotificationTokenId, type RecipientId, type Thread, type ThreadId, type ThreadMessage, type ThreadMessageAttachment, type ThreadMessageRecipient, type User, type UserId, type UserPushNotificationToken, type UserView, type ViewId, } from './schemas';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAA;AACnB,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,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,K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K,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,MAAM,GACZ,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
@@ -1,4 +1,4 @@
1
- export { appwrite, appwriteCommands, appwriteFunctions, } from './appwrite';
1
+ export { appwrite, appwriteAvatar, appwriteCommands, appwriteFunctions, } from './appwrite';
2
2
  export { marcoConstants } from './constants';
3
3
  export { MARCO_ENV, marcoPublicConfig } from './marcoPublicConfig';
4
4
  export { marcoSchemas, } from './schemas';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "2.0.579",
3
+ "version": "2.0.580",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",