@marcoappio/marco-config 3.0.8 → 3.0.9

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.
@@ -471,6 +471,22 @@ export declare const appwriteFunctions: {
471
471
  readonly state: v.LiteralSchema<"COMPLETED", undefined>;
472
472
  }, undefined>;
473
473
  };
474
+ readonly pollsRun: {
475
+ errorSchema: v.StrictObjectSchema<{
476
+ readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
477
+ readonly retryable: v.BooleanSchema<undefined>;
478
+ }, undefined>;
479
+ context: "internal";
480
+ method: "POST";
481
+ path: "/polls/run";
482
+ requestSchema: v.StrictObjectSchema<{
483
+ readonly scheduledFor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>, v.CheckAction<string, undefined>]>;
484
+ readonly shardId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
485
+ }, undefined>;
486
+ responseSchema: v.StrictObjectSchema<{
487
+ readonly state: v.LiteralSchema<"COMPLETED", undefined>;
488
+ }, undefined>;
489
+ };
474
490
  readonly profileEnsure: {
475
491
  errorSchema: v.StrictObjectSchema<{
476
492
  readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
@@ -525,22 +541,6 @@ export declare const appwriteFunctions: {
525
541
  readonly state: v.LiteralSchema<"COMPLETED", undefined>;
526
542
  }, undefined>;
527
543
  };
528
- readonly pollsRun: {
529
- errorSchema: v.StrictObjectSchema<{
530
- readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
531
- readonly retryable: v.BooleanSchema<undefined>;
532
- }, undefined>;
533
- context: "internal";
534
- method: "POST";
535
- path: "/polls/run";
536
- requestSchema: v.StrictObjectSchema<{
537
- readonly scheduledFor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>, v.CheckAction<string, undefined>]>;
538
- readonly shardId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
539
- }, undefined>;
540
- responseSchema: v.StrictObjectSchema<{
541
- readonly state: v.LiteralSchema<"COMPLETED", undefined>;
542
- }, undefined>;
543
- };
544
544
  readonly supervisor: {
545
545
  errorSchema: v.StrictObjectSchema<{
546
546
  readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
@@ -111,6 +111,16 @@ const apiRoutes = {
111
111
  }),
112
112
  responseSchema: completedSchema,
113
113
  }),
114
+ pollsRun: createRoute({
115
+ context: 'internal',
116
+ method: 'POST',
117
+ path: '/polls/run',
118
+ requestSchema: v.strictObject({
119
+ scheduledFor: timestampSchema,
120
+ shardId: appwriteRowIdSchema,
121
+ }),
122
+ responseSchema: completedSchema,
123
+ }),
114
124
  profileEnsure: createRoute({
115
125
  context: 'authenticated',
116
126
  method: 'POST',
@@ -137,16 +147,6 @@ const workerRoutes = {
137
147
  requestSchema: v.strictObject({ jobId: id.jobId.required() }),
138
148
  responseSchema: completedSchema,
139
149
  }),
140
- pollsRun: createRoute({
141
- context: 'internal',
142
- method: 'POST',
143
- path: '/polls/run',
144
- requestSchema: v.strictObject({
145
- scheduledFor: timestampSchema,
146
- shardId: appwriteRowIdSchema,
147
- }),
148
- responseSchema: completedSchema,
149
- }),
150
150
  supervisor: createRoute({
151
151
  context: 'internal',
152
152
  method: 'POST',
@@ -107,7 +107,7 @@ const routeFixtures = [
107
107
  name: 'poll runner',
108
108
  request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test-poll-shard-id-1' },
109
109
  response: { state: 'COMPLETED' },
110
- route: () => appwriteFunctions.worker.routes.pollsRun,
110
+ route: () => appwriteFunctions.api.routes.pollsRun,
111
111
  },
112
112
  {
113
113
  name: 'watcher runner',
@@ -127,9 +127,9 @@ describe('appwriteFunctions', () => {
127
127
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pushTokens },
128
128
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountDelete },
129
129
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.oauthWebhook },
130
+ { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pollsRun },
130
131
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.supervisor },
131
132
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.jobsRun },
132
- { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.pollsRun },
133
133
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.watchersRun },
134
134
  ].map(({ functionId, route }) => ({
135
135
  context: route.context,
@@ -145,9 +145,9 @@ describe('appwriteFunctions', () => {
145
145
  { context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/push-tokens' },
146
146
  { context: 'authenticated', functionId: 'marco-api', method: 'DELETE', path: '/account/delete' },
147
147
  { context: 'webhook', functionId: 'marco-api', method: 'GET', path: '/v1/wh/oauth/callback' },
148
+ { context: 'internal', functionId: 'marco-api', method: 'POST', path: '/polls/run' },
148
149
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/' },
149
150
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/jobs/run' },
150
- { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/polls/run' },
151
151
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/watchers/run' },
152
152
  ]);
153
153
  });
@@ -182,7 +182,7 @@ describe('appwriteFunctions', () => {
182
182
  {
183
183
  description: 'poll',
184
184
  request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test invalid shard id' },
185
- requestSchema: appwriteFunctions.worker.routes.pollsRun.requestSchema,
185
+ requestSchema: appwriteFunctions.api.routes.pollsRun.requestSchema,
186
186
  },
187
187
  {
188
188
  description: 'watcher',
@@ -219,7 +219,7 @@ describe('appwriteFunctions', () => {
219
219
  },
220
220
  ]) {
221
221
  it(`rejects a poll request with ${description}`, () => {
222
- expect(v.safeParse(appwriteFunctions.worker.routes.pollsRun.requestSchema, request).success).toBe(false);
222
+ expect(v.safeParse(appwriteFunctions.api.routes.pollsRun.requestSchema, request).success).toBe(false);
223
223
  });
224
224
  }
225
225
  it('redacts credentials from connection responses and compact errors', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",